thread/spinlock: add move assignment

This commit is contained in:
Danny Robson 2019-05-24 11:21:43 +10:00
parent 257275e0f5
commit 25a74badd6

View File

@ -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
spinlock::lock (void)