CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Lock< Mutexes > Class Template Referencefinal

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>

Inheritance diagram for CeresEngine::Lock< Mutexes >:

Private Types

using super = std::scoped_lock< Mutexes... >
 

Detailed Description

template<typename... Mutexes>
class CeresEngine::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.

Template Parameters
Mutexesthe 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.

Member Typedef Documentation

◆ super

template<typename... Mutexes>
using CeresEngine::Lock< Mutexes >::super = std::scoped_lock<Mutexes...>
private

The documentation for this class was generated from the following file: