mbed-os/rtos
Christopher Haster a6e21a805e 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-12-01 17:01:45 +00:00
..
TARGET_CORTEX Fixed mutex assert in armcc fopen and related memory leak 2017-12-01 17:01:45 +00:00
EventFlags.cpp Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
EventFlags.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Mail.h Doxygen comment updates and fixes 2017-11-17 14:55:46 +00:00
MemoryPool.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Mutex.cpp Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Mutex.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Queue.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
RtosTimer.cpp Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
RtosTimer.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Semaphore.cpp Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Semaphore.h Revert "Shrink RTOS classes" 2017-11-21 13:31:47 +00:00
Thread.cpp Ensure Thread stack is 8 byte aligned 2017-11-03 13:02:56 +00:00
Thread.h Doxygen comment updates and fixes 2017-11-17 14:55:46 +00:00
mbed_lib.json RTOS - add config mbed_lib.json file 2016-06-08 18:41:29 +01:00
rtos.h Remove use of internal RTX types 2017-09-04 11:26:38 -05:00
rtos_idle.h Doxygen comment updates and fixes 2017-11-17 14:55:46 +00:00