Tkrzw
|
Spin lock mutex. More...
#include <tkrzw_thread_util.h>
Public Member Functions | |
SpinMutex () | |
Constructor. More... | |
SpinMutex (const SpinMutex &rhs)=delete | |
Copy and assignment are disabled. More... | |
SpinMutex & | operator= (const SpinMutex &rhs)=delete |
void | lock () |
Gets exclusive ownership of the lock. More... | |
bool | try_lock () |
Tries to get exclusive ownership of the lock. More... | |
void | unlock () |
Releases exclusive ownership of the lock. More... | |
Spin lock mutex.
tkrzw::SpinMutex::SpinMutex | ( | ) |
Constructor.
|
explicitdelete |
Copy and assignment are disabled.
void tkrzw::SpinMutex::lock | ( | ) |
Gets exclusive ownership of the lock.
Precondition: The thread doesn't have the exclusive ownership.
bool tkrzw::SpinMutex::try_lock | ( | ) |
Tries to get exclusive ownership of the lock.
Precondition: The thread doesn't have the exclusive ownership.
void tkrzw::SpinMutex::unlock | ( | ) |
Releases exclusive ownership of the lock.
Precondition: The thread has the exclusive ownership.