summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 14:40:04 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 14:42:25 +0000
commitb77f2d923898eb0a0edefd53b9ba2f59edcc62a1 (patch)
tree7d44c3c1083e9cc5a9aa432c364421e7a4ce1820
parentAllow recursion in AssertRead (diff)
downloadnetfs-b77f2d923898eb0a0edefd53b9ba2f59edcc62a1.tar.bz2
netfs-b77f2d923898eb0a0edefd53b9ba2f59edcc62a1.tar.xz
netfs-b77f2d923898eb0a0edefd53b9ba2f59edcc62a1.zip
Add mutex in vlogf function calling BOOST_TEST_MESSAGE
-rw-r--r--netfs/unittests/testFuse.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/netfs/unittests/testFuse.cpp b/netfs/unittests/testFuse.cpp
index 1185a7f..0810fbf 100644
--- a/netfs/unittests/testFuse.cpp
+++ b/netfs/unittests/testFuse.cpp
@@ -7,6 +7,7 @@
#include <filesystem>
#include <fuse.h>
#include <fuseApp.h>
+#include <lockHelpers.h>
#include <ostream>
#include <thread>
@@ -78,7 +79,10 @@ public:
vlogf(int, const char * fmt, va_list args) const noexcept override
{
std::unique_ptr<char, void (*)(void *)> msg(vstrdupf(fmt, args), std::free);
- BOOST_TEST_MESSAGE(msg.get());
+ static std::mutex btm;
+ ScopeLock(btm) {
+ BOOST_TEST_MESSAGE(msg.get());
+ }
}
struct fuse * fs;