Signed-off-by: myperworld <myperworld@126.com>

This commit is contained in:
myperworld committed 2025-10-06 12:34:26 +08:00
1 parent 0986832fd1
commit aacd052c06
3403 files changed
+597376 -12

No files matched your search

@@ -0,0 +1,18 @@
#include "test.h"
#include "fl/mutex.h"
TEST_CASE("Mutex reentrant") {
// Tests that the lock can be acquired multiple times by the same thread.
{
fl::mutex m;
fl::lock_guard<fl::mutex> lock(m);
{
// This will deadlock.
bool acquired_recursively = m.try_lock();
CHECK_EQ(acquired_recursively, true);
m.unlock();
}
}
}