diff options
-rw-r--r-- | storage/src/tests/persistence/filestorage/filestormanagertest.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp index 61c55248370..f03d2fa3647 100644 --- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp +++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp @@ -20,6 +20,7 @@ #include <vespa/persistence/spi/test.h> #include <vespa/config/common/exceptions.h> #include <vespa/fastos/file.h> +#include <atomic> #include <vespa/log/log.h> LOG_SETUP(".filestormanagertest"); @@ -668,8 +669,8 @@ class MessagePusherThread : public document::Runnable public: FileStorHandler& _handler; Document::SP _doc; - bool _done; - bool _threadDone; + std::atomic<bool> _done; + std::atomic<bool> _threadDone; MessagePusherThread(FileStorHandler& handler, Document::SP doc); ~MessagePusherThread(); @@ -698,10 +699,10 @@ public: const uint32_t _threadId; FileStorHandler& _handler; std::atomic<uint32_t> _config; - uint32_t _fetchedCount; - bool _done; - bool _failed; - bool _threadDone; + std::atomic<uint32_t> _fetchedCount; + std::atomic<bool> _done; + std::atomic<bool> _failed; + std::atomic<bool> _threadDone; MessageFetchingThread(FileStorHandler& handler) : _threadId(handler.getNextStripeId(0)), _handler(handler), _config(0), _fetchedCount(0), _done(false), @@ -766,7 +767,7 @@ FileStorManagerTest::testHandlerPausedMultiThread() ResumeGuard guard = filestorHandler.pause(); thread._config.fetch_add(1); uint32_t count = thread._fetchedCount; - CPPUNIT_ASSERT_EQUAL(count, thread._fetchedCount); + CPPUNIT_ASSERT_EQUAL(count, thread._fetchedCount.load()); } pushthread._done = true; |