mbed-os/rtos
Christopher Haster 7e45aee8a5 Fixed mutex assert in armcc fopen and related memory leak
armcc fopen allocated a mutex using the retargeted system-level
_mutex_initialize function. Interestingly, malloc also uses this
same _mutex_initialization function, which prevents a full solution
relying on malloc. The solution previously implemented involved using
the rtx mutex pool for the first 8 mutexes, then falling back on
malloc.

The previous implementation relied on osMutexNew returning an error
on out-of-memory. An unrelated change causes osMutexNew to instead
assert (except for release mode). This meant if you exceed 8 system-
level mutexes in armcc you will hit an assert. Since the filesystem
code can call fopen an unlimited number of times, this is a problem.

Solution is to keep track of which static mutexes we've allocated, so
we know before calling osMutexNew if we need to call malloc.

Also _mutex_free never deallocated the malloced mutexes, which would
cause fopen to leak memory.
2017-11-22 16:53:19 -06:00
..
TARGET_CORTEX Fixed mutex assert in armcc fopen and related memory leak 2017-11-22 16:53:19 -06:00
ConditionVariable.cpp Fix and add test for ConditionVariable 2017-11-15 16:15:27 -06:00
ConditionVariable.h Fix and add test for ConditionVariable 2017-11-15 16:15:27 -06:00
EventFlags.cpp Shrink RTOS classes 2017-11-03 15:22:22 +02:00
EventFlags.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
Mail.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
MemoryPool.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
Mutex.cpp Merge pull request #3648 from c1728p9/condition_variable 2017-11-09 16:38:02 +00:00
Mutex.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
Queue.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
RtosTimer.cpp Shrink RTOS classes 2017-11-03 15:22:22 +02:00
RtosTimer.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
Semaphore.cpp Shrink RTOS classes 2017-11-03 15:22:22 +02:00
Semaphore.h Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates 2017-11-09 16:38:45 +00:00
Thread.cpp Ensure Thread stack is 8 byte aligned 2017-10-31 11:58:18 -05:00
Thread.h Doxygen comment updates and fixes 2017-10-26 15:36:26 -05:00
mbed_lib.json RTOS - add config mbed_lib.json file 2016-06-08 18:41:29 +01:00
rtos.h Add ConditionVariable to mbed rtos 2017-11-02 21:02:27 -05:00
rtos_idle.h Doxygen comment updates and fixes 2017-10-26 15:36:26 -05:00