std::atomic doesn't need volatile
All checks were successful
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 0s
Run UnitTests / build-and-run-tests (push) Successful in 25s

This commit is contained in:
Stephen Seo 2024-01-14 10:31:38 +09:00
parent ef164561c1
commit 2cef0d541c

View file

@ -74,9 +74,9 @@ public:
SharedSpinLock(const SharedSpinLock&) = delete; SharedSpinLock(const SharedSpinLock&) = delete;
SharedSpinLock& operator=(const SharedSpinLock&) = delete; SharedSpinLock& operator=(const SharedSpinLock&) = delete;
// Disallow move. // Enable move.
SharedSpinLock(SharedSpinLock&&) = delete; SharedSpinLock(SharedSpinLock&&) = default;
SharedSpinLock& operator=(SharedSpinLock&&) = delete; SharedSpinLock& operator=(SharedSpinLock&&) = default;
LockObj<false> spin_read_lock(); LockObj<false> spin_read_lock();
LockObj<false> try_spin_read_lock(); LockObj<false> try_spin_read_lock();
@ -98,7 +98,7 @@ private:
Weak selfWeakPtr; Weak selfWeakPtr;
/// Used to lock the read/write member variables. /// Used to lock the read/write member variables.
volatile std::atomic_bool spinLock; std::atomic_bool spinLock;
unsigned int read; unsigned int read;
bool write; bool write;