mbed-os/rtos/TARGET_CORTEX
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
..
rtx4 Move Cortex specific RTX behind TARGET_CORTEX 2017-08-31 19:55:54 -05:00
rtx5 Move heap_and_stack tests 2017-10-20 16:18:30 +01:00
mbed_boot.c Fixed mutex assert in armcc fopen and related memory leak 2017-12-01 17:01:45 +00:00
mbed_rtos1_types.h Move Cortex specific RTX behind TARGET_CORTEX 2017-08-31 19:55:54 -05:00
mbed_rtos_storage.h Remove use of internal RTX types 2017-09-04 11:26:38 -05:00
mbed_rtx_conf.h Add error if OS tickrate is changed 2017-10-20 16:18:28 +01:00
mbed_rtx_handlers.c Added thread terminate hook 2017-09-24 21:34:29 +01:00
mbed_rtx_idle.cpp mbed_rtx_idle: uVisor: Don't attempt to sleep 2017-09-19 11:36:37 +01:00