Tkrzw
Public Member Functions | List of all members
tkrzw::ScopedSlottedLock< SHAREDMUTEX > Class Template Referencefinal

Scoped lock with a slotted shared mutex. More...

#include <tkrzw_thread_util.h>

Public Member Functions

 ScopedSlottedLock (SlottedMutex< SHAREDMUTEX > &mutex, int32_t index, bool writable)
 Constructor. More...
 
 ~ScopedSlottedLock ()
 Destructor. More...
 
 ScopedSlottedLock (const ScopedSlottedLock &rhs)=delete
 Copy and assignment are disabled. More...
 
ScopedSlottedLockoperator= (const ScopedSlottedLock &rhs)=delete
 

Detailed Description

template<typename SHAREDMUTEX = std::shared_mutex>
class tkrzw::ScopedSlottedLock< SHAREDMUTEX >

Scoped lock with a slotted shared mutex.

Constructor & Destructor Documentation

◆ ScopedSlottedLock() [1/2]

template<typename SHAREDMUTEX >
tkrzw::ScopedSlottedLock< SHAREDMUTEX >::ScopedSlottedLock ( SlottedMutex< SHAREDMUTEX > &  mutex,
int32_t  index,
bool  writable 
)

Constructor.

Parameters
mutexA slotted shared mutex.
indexThe index of a slot. Negative means all slots.
writableTrue for exclusive lock. False for shared lock.

◆ ~ScopedSlottedLock()

template<typename SHAREDMUTEX >
tkrzw::ScopedSlottedLock< SHAREDMUTEX >::~ScopedSlottedLock

Destructor.

◆ ScopedSlottedLock() [2/2]

template<typename SHAREDMUTEX = std::shared_mutex>
tkrzw::ScopedSlottedLock< SHAREDMUTEX >::ScopedSlottedLock ( const ScopedSlottedLock< SHAREDMUTEX > &  rhs)
explicitdelete

Copy and assignment are disabled.