mbed-os/storage/blockdevice
Lingkai Dong 0b868d5a1a General block device test: Fix thread stack allocation
The test case for multithreaded erase/program/read allocates a few
Thread objects from the heap and starts them. It has a few problems:

* To check that there will be enough heap to start a new thread, the
test case tries to allocate a dummy buffer of the thread's heap size
and then frees it, before starting the thread. Then the thread will
allocate its own stack. Such check is not reliable, because threads
that are already running also perform additional allocation (when
running `test_thread_job()`) and may take away the memory we just
checked.
* When deleting all threads in a loop, the loop boundary misses the
last thread if the last thread object was allocated but not started
(i.e. due to failed thread stack allocation check).

To fix the issues
* Start a thread without any allocation test. Following the preceding
commit "rtos: Thread: Make stack allocation failure runtime catchable",
`Thread::start()` now returns `osErrorNoMemory` if stack allocation
fails which we can handle.
* Store pointers to all threads in a zero-initialized array, and
free all elements at the end of the test.
2021-09-08 14:18:21 +01:00
..
COMPONENT_DATAFLASH BlockDevices: specify mbed namespace where needed 2021-02-02 12:49:09 +01:00
COMPONENT_FLASHIAP BlockDevices: specify mbed namespace where needed 2021-02-02 12:49:09 +01:00
COMPONENT_I2CEE BlockDevices: specify mbed namespace where needed 2021-02-02 12:49:09 +01:00
COMPONENT_OSPIF Merge pull request #14221 from macronix/macronix_rww 2021-06-02 16:53:59 +02:00
COMPONENT_QSPIF BlockDevices: specify mbed namespace where needed 2021-02-02 12:49:09 +01:00
COMPONENT_SD Add standard pin-names validation script & tests 2021-03-18 17:01:53 +00:00
COMPONENT_SPIF Merge pull request #14909 from DDC-NDRS/ndrs-pst 2021-07-20 09:55:08 +02:00
COMPONENT_SPINAND Update SPINANDBlockDevice.cpp 2021-06-10 09:47:43 +08:00
include/blockdevice HeapBlockDevice::erase(): free up heap memory 2021-04-14 17:00:17 +01:00
source SFDP: Set region count to 1 for no sector map 2021-08-06 14:30:16 +01:00
tests General block device test: Fix thread stack allocation 2021-09-08 14:18:21 +01:00
CMakeLists.txt CMake: Add option to enable greentea tests 2021-08-10 16:35:11 +01:00
mbed_lib.json Added missing blockdevice mbed_lib.json 2020-11-02 16:35:26 +00:00