diff options
Diffstat (limited to 'storageframework')
-rw-r--r-- | storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.cpp | 4 | ||||
-rw-r--r-- | storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.cpp b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.cpp index b9ccb2d4d9f..7c30944d911 100644 --- a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.cpp +++ b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.cpp @@ -46,7 +46,7 @@ ThreadImpl::run() bool ThreadImpl::interrupted() const { - return _interrupted; + return _interrupted.load(std::memory_order_relaxed); } bool @@ -58,7 +58,7 @@ ThreadImpl::joined() const void ThreadImpl::interrupt() { - _interrupted = true; + _interrupted.store(true, std::memory_order_relaxed); _thread.stop(); } diff --git a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.h b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.h index 798251f0573..bb89c9167a3 100644 --- a/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.h +++ b/storageframework/src/vespa/storageframework/defaultimplementation/thread/threadimpl.h @@ -42,7 +42,7 @@ class ThreadImpl : public Thread ThreadProperties _properties; std::array<AtomicThreadTickData, 3> _tickData; uint32_t _tickDataPtr; - bool _interrupted; + std::atomic<bool> _interrupted; bool _joined; BackendThread _thread; |