| 4 | #include "platforms/stub/mutex_stub_stl.h" |
| 5 | |
| 6 | FL_TEST_FILE(FL_FILEPATH) { |
| 7 | |
| 8 | |
| 9 | FL_TEST_CASE("Mutex reentrant") { |
| 10 | // Tests that the lock can be acquired multiple times by the same thread. |
| 11 | { |
| 12 | fl::recursive_mutex m; |
| 13 | fl::unique_lock<fl::recursive_mutex> lock(m); |
| 14 | { |
| 15 | // This should succeed with recursive_mutex |
| 16 | bool acquired_recursively = m.try_lock(); |
| 17 | FL_CHECK_EQ(acquired_recursively, true); |
| 18 | m.unlock(); |
| 19 | } |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | } // FL_TEST_FILE |