mbed-os/storage
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
..
blockdevice General block device test: Fix thread stack allocation 2021-09-08 14:18:21 +01:00
docs Refactor KVStore config override explanation 2021-05-11 17:19:16 +01:00
filesystem CMake: Add option to enable greentea tests 2021-08-10 16:35:11 +01:00
kvstore CMake: Add option to enable greentea tests 2021-08-10 16:35:11 +01:00
platform CMake: Rename CMake targets 2020-11-06 17:25:22 +00:00
CMakeLists.txt Unit tests: Create mbed-headers-filesystem 2021-07-02 16:25:43 +01:00