CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::TAsyncMutex< ExecutorType >::Lock Class Reference

An object that holds onto a mutex lock for its lifetime and ensures that the mutex is unlocked when it is destructed. More...

#include <CeresEngine/Foundation/Threading/AsyncMutex.hpp>

Public Member Functions

 Lock (TAsyncMutex &mutex, std::adopt_lock_t) noexcept
 
 Lock (Lock &&other) noexcept
 
Lockoperator= (Lock &&other) noexcept
 
 Lock (const Lock &other)=delete
 
Lockoperator= (const Lock &other)=delete
 
 ~Lock ()
 
void unlock ()
 

Private Member Functions

void release ()
 

Private Attributes

TAsyncMutexmMutex
 

Detailed Description

template<typename ExecutorType = InlineExecutor>
class CeresEngine::TAsyncMutex< ExecutorType >::Lock

An object that holds onto a mutex lock for its lifetime and ensures that the mutex is unlocked when it is destructed.

It is equivalent to a std::lock_guard object but requires that the result of co_await AsyncMutex::lock() is passed to the constructor rather than passing the AsyncMutex object itself.

Constructor & Destructor Documentation

◆ Lock() [1/3]

template<typename ExecutorType = InlineExecutor>
CeresEngine::TAsyncMutex< ExecutorType >::Lock::Lock ( TAsyncMutex mutex,
std::adopt_lock_t   
)
inlineexplicitnoexcept

◆ Lock() [2/3]

template<typename ExecutorType = InlineExecutor>
CeresEngine::TAsyncMutex< ExecutorType >::Lock::Lock ( Lock &&  other)
inlinenoexcept

◆ Lock() [3/3]

template<typename ExecutorType = InlineExecutor>
CeresEngine::TAsyncMutex< ExecutorType >::Lock::Lock ( const Lock other)
delete

◆ ~Lock()

template<typename ExecutorType = InlineExecutor>
CeresEngine::TAsyncMutex< ExecutorType >::Lock::~Lock ( )
inline

Member Function Documentation

◆ operator=() [1/2]

template<typename ExecutorType = InlineExecutor>
Lock & CeresEngine::TAsyncMutex< ExecutorType >::Lock::operator= ( const Lock other)
delete

◆ operator=() [2/2]

template<typename ExecutorType = InlineExecutor>
Lock & CeresEngine::TAsyncMutex< ExecutorType >::Lock::operator= ( Lock &&  other)
inlinenoexcept

◆ release()

template<typename ExecutorType = InlineExecutor>
void CeresEngine::TAsyncMutex< ExecutorType >::Lock::release ( )
inlineprivate

◆ unlock()

template<typename ExecutorType = InlineExecutor>
void CeresEngine::TAsyncMutex< ExecutorType >::Lock::unlock ( )
inline

Member Data Documentation

◆ mMutex

template<typename ExecutorType = InlineExecutor>
TAsyncMutex* CeresEngine::TAsyncMutex< ExecutorType >::Lock::mMutex
private

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