diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-12-03 19:26:56 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-12-03 19:26:56 +0000 |
commit | e163dd29c64d39d3a2378096e21411c214e92cdb (patch) | |
tree | 62651b7dc695803baabcb8196bf6dc5ac03a7205 | |
parent | Tidy fixes (diff) | |
download | libadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.tar.bz2 libadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.tar.xz libadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.zip |
Add lock around check - thread-sanitizer fix
-rw-r--r-- | libadhocutil/unittests/testResourcePool.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libadhocutil/unittests/testResourcePool.cpp b/libadhocutil/unittests/testResourcePool.cpp index a6db002..f1b9c04 100644 --- a/libadhocutil/unittests/testResourcePool.cpp +++ b/libadhocutil/unittests/testResourcePool.cpp @@ -320,7 +320,10 @@ static void acquireAndKeepFor1Second(TRPSmall * pool, AdHoc::Semaphore & s) { auto r = pool->get(); - BOOST_CHECK(r); + static std::mutex m; + ScopeLock(m) { + BOOST_CHECK(r); + } s.notify(); sleep(1); } |