|
CeresEngine 0.2.0
A game development framework
|
The class Lock is a mutex wrapper that provides a convenient RAII-style mechanism for owning one or more mutexes for the duration of a scoped block.
More...
#include <CeresEngine/Foundation/Threading/Threading.hpp>
Private Types | |
| using | super = std::scoped_lock< Mutexes... > |
The class Lock is a mutex wrapper that provides a convenient RAII-style mechanism for owning one or more mutexes for the duration of a scoped block.
When a Lock object is created, it attempts to take ownership of the mutexes it is given. When control leaves the scope in which the Lock object was created, the Lock is destructed and the mutexes are released, in reverse order. If several mutexes are given, deadlock avoidance algorithm is used as if by std::lock.
The Lock class is non-copyable.
| Mutexes | the types of the mutexes to lock. The types must meet the Lockable requirements unless sizeof...(Mutexes)==1, in which case the only type must meet BasicLockable. |
|
private |