Lely core libraries
2.3.4
|
Go to the documentation of this file.
22 #ifndef LELY_UTIL_MUTEX_H_
23 #define LELY_UTIL_MUTEX_H_
40 virtual void lock() = 0;
56 template <
class Mutex>
95 #endif // LELY_UTIL_MUTEX_H_
An abstract interface conforming to the BasicLockable concept.
UnlockGuard(MutexType &m)
Releases ownership of m and calls m.unlock().
A mutex wrapper that provides a convenient RAII-style mechanism for releasing a mutex for the duratio...
Mutex MutexType
The type of the mutex to unlock.
~UnlockGuard()
Acquires ownership of m and calls m.lock(), where m is the mutex passed to the constructor.
virtual void lock()=0
Blocks until a lock can be obtained for the current execution agent (thread, process,...
UnlockGuard(MutexType &m, ::std::adopt_lock_t)
Releases ownership of m without attempting to unlock it.
virtual void unlock()=0
Releases the lock held by the execution agent. Throws no exceptions.