thread/spinlock: add move assignment
This commit is contained in:
parent
257275e0f5
commit
25a74badd6
@ -27,6 +27,21 @@ spinlock::spinlock (spinlock &&rhs) noexcept:
|
|||||||
{ ; }
|
{ ; }
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
spinlock& spinlock::operator= (spinlock &&rhs) noexcept
|
||||||
|
{
|
||||||
|
lock ();
|
||||||
|
rhs.lock ();
|
||||||
|
|
||||||
|
held = rhs.held.load ();
|
||||||
|
|
||||||
|
rhs.unlock ();
|
||||||
|
unlock ();
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
void
|
void
|
||||||
spinlock::lock (void)
|
spinlock::lock (void)
|
||||||
|
Loading…
Reference in New Issue
Block a user