libfilezilla
|
A simple scoped lock. More...
#include <mutex.hpp>
Public Member Functions | |
scoped_lock (mutex &m) | |
scoped_lock (scoped_lock const &)=delete | |
scoped_lock & | operator= (scoped_lock const &)=delete |
scoped_lock (scoped_lock &&op) noexcept | |
scoped_lock & | operator= (scoped_lock &&op) noexcept |
void | lock () |
Obtains the mutex. More... | |
void | unlock () |
Releases the mutex. More... | |
Friends | |
class | condition |
A simple scoped lock.
The lock is acquired on construction and, if still locked, released on destruction. You can manually unlock and re-lock if needed.
|
inline |
Obtains the mutex.
Locking an already locked scoped_lock results in undefined behavior.
|
inline |
Releases the mutex.
Releasing a scoped_lock that isn't locked results in undefined behavior.