40 explicit AccessLock(TMutex& mutex) :
43 this->g_mutex->lock();
45 ~AccessLock() { this->g_mutex->unlock(); }
47 AccessLock(AccessLock
const&) =
delete;
48 AccessLock(AccessLock&&)
noexcept =
delete;
50 AccessLock& operator=(AccessLock
const&) =
delete;
51 AccessLock& operator=(AccessLock&&)
noexcept =
delete;
53 [[nodiscard]]
inline bool operator==(TMutex
const& r)
const {
return this->g_mutex == &r; }
54 [[nodiscard]]
inline bool operator!=(TMutex
const& r)
const {
return this->g_mutex != &r; }
56 inline void throwIfDifferent(TMutex
const& r)
const
58 if (this->g_mutex != &r)
64 [[nodiscard]]
inline AccessLock<TMutex>* operator&() =
delete;