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

A scoped RAII lock holder for a AsyncSharedMutex. More...

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

Public Member Functions

 Lock (TAsyncSharedMutex &sm, const bool exclusive)
 
 ~Lock ()
 Unlocks the mutex upon this shared scoped lock destructing.
 
 Lock (const Lock &)=delete
 
Lockoperator= (const Lock &)=delete
 
 Lock (Lock &&other) noexcept
 
Lockoperator= (Lock &&other) noexcept
 
void unlock ()
 Unlocks the shared mutex prior to this lock going out of scope.
 
bool isExclusive () const noexcept
 

Private Attributes

TAsyncSharedMutexmMutex {nullptr}
 
bool mExclusive {false}
 

Detailed Description

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

A scoped RAII lock holder for a AsyncSharedMutex.

It will call the appropriate unlock() or unlock_shared() based on how the AsyncSharedMutex was originally acquired, either shared or exclusive modes.

Constructor & Destructor Documentation

◆ Lock() [1/3]

template<typename ExecutorType = InlineExecutor>
CeresEngine::TAsyncSharedMutex< ExecutorType >::Lock::Lock ( TAsyncSharedMutex sm,
const bool  exclusive 
)
inline

◆ ~Lock()

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

Unlocks the mutex upon this shared scoped lock destructing.

◆ Lock() [2/3]

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

◆ Lock() [3/3]

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

Member Function Documentation

◆ isExclusive()

template<typename ExecutorType = InlineExecutor>
bool CeresEngine::TAsyncSharedMutex< ExecutorType >::Lock::isExclusive ( ) const
inlinenoexcept

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ unlock()

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

Unlocks the shared mutex prior to this lock going out of scope.

Member Data Documentation

◆ mExclusive

template<typename ExecutorType = InlineExecutor>
bool CeresEngine::TAsyncSharedMutex< ExecutorType >::Lock::mExclusive {false}
private

◆ mMutex

template<typename ExecutorType = InlineExecutor>
TAsyncSharedMutex* CeresEngine::TAsyncSharedMutex< ExecutorType >::Lock::mMutex {nullptr}
private

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