Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ if (QUANTUM_VERBOSE_MAKEFILE)
message(STATUS "REQUIRED BOOST_VERSION = 1.61")
message(STATUS "GTEST_ROOT = ${GTEST_ROOT}")
endif()

13 changes: 13 additions & 0 deletions quantum/impl/quantum_spinlock_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ namespace quantum {
//==============================================================================
// SpinLock
//==============================================================================
inline
SpinLock::SpinLock(SpinLock&& o) : _flag(o._flag.load()) { }

inline
SpinLock& SpinLock::operator=(SpinLock&& o)
{
if(this != &o)
{
_flag.store(o._flag.load());
}
return *this;
}

inline
void SpinLock::lock()
{
Expand Down
4 changes: 2 additions & 2 deletions quantum/quantum_spinlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class SpinLock
SpinLock(const SpinLock&) = delete;

/// @brief Move constructor.
SpinLock(SpinLock&&) = default;
SpinLock(SpinLock&&);

/// @brief Copy assignment operator.
SpinLock& operator=(const SpinLock&) = delete;

/// @brief Move assignment operator.
SpinLock& operator=(SpinLock&&) = default;
SpinLock& operator=(SpinLock&&);

/// @brief Locks this object.
/// @note Blocks the current thread until the lock is acquired. Blocking is achieved
Expand Down