Model Types
spin_rw_mutex and queuing_rw_mutex model the ReaderWriterMutex Concept.
-
ReaderWriterMutex() Effect: constructs an unlocked
ReaderWriterMutex.-
~ReaderWriterMutex() Effect: destroys an unlocked
ReaderWriterMutex. The effect of destroying a lockedReaderWriterMutexis undefined.-
ReaderWriterMutex::scoped_lock() Effect: constructs a
scoped_lockobject that does not hold a lock on any mutex.-
ReaderWriterMutex::scoped_lock( ReaderWriterMutex& rw, bool write=true) Effect: constructs a
scoped_lockobject that acquires a lock on mutexrw. The lock is a writer lock ifwriteistrue; it is a reader lock otherwise.-
ReaderWriterMutex::~scoped_lock() Effect: if the object is holding a lock on a
ReaderWriterMutex, releases the lock.-
void ReaderWriterMutex:: scoped_lock:: acquire( ReaderWriterMutex& rw, bool write=true) Effect: acquires a lock on mutex
rw. The lock is a writer lock ifwriteistrue; it is a reader lock otherwise.-
bool ReaderWriterMutex:: scoped_lock::try_acquire( ReaderWriterMutex& rw, bool write=true) Effect: attempts to acquire a lock on mutex
rw. The lock is a writer lock ifwriteistrue; it is a reader lock otherwise.Returns:
trueif the lock is acquired,falseotherwise.-
voidReaderWriterMutex:: scoped_lock::release() Effect: releases the lock. The effect is undefined if no lock is held.
-
bool ReaderWriterMutex:: scoped_lock::upgrade_to_writer() Effect: changes a reader lock to a writer lock. The effect is undefined if the object does not already hold a reader ...