summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-03 19:26:56 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-03 19:26:56 +0000
commite163dd29c64d39d3a2378096e21411c214e92cdb (patch)
tree62651b7dc695803baabcb8196bf6dc5ac03a7205
parentTidy fixes (diff)
downloadlibadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.tar.bz2
libadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.tar.xz
libadhocutil-e163dd29c64d39d3a2378096e21411c214e92cdb.zip
Add lock around check - thread-sanitizer fix
-rw-r--r--libadhocutil/unittests/testResourcePool.cpp5
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);
}