Class Avogadro::Core::SharedMutex#

class SharedMutex#

The SharedMutex class provides a simple wrapper for the C++17 shared_mutex class.

A very simple, and thin wrapper around the C++17 shared_mutex class, allowing for lock, tryLock and unlock.

Author

Marcus D. Hanwell

Public Functions

SharedMutex()#
~SharedMutex()#
void lockForRead()#

Obtain a shared read lock.

bool tryLockForRead()#

Attempt to obtain a shared read lock.

Returns:

True on success, false on failure.

void unlockForRead()#

Unlocks the exclusive write lock.

void lockForWrite()#

Obtain an exclusive write lock.

bool tryLockForWrite()#

Attempt to obtain an exclusive write lock.

Returns:

True on success, false on failure.

void unlockForWrite()#

Unlocks the exclusive write lock.