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 locked ReaderWriterMutex is undefined.

ReaderWriterMutex::scoped_lock()

Effect: constructs a scoped_lock object that does not hold a lock on any mutex.

ReaderWriterMutex::scoped_lock( ReaderWriterMutex& rw, bool write=true)

Effect: constructs a scoped_lock object that acquires a lock on mutex rw. The lock is a writer lock if write is true; 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 if write is true; 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 if write is true; it is a reader lock otherwise.

Returns: true if the lock is acquired, false otherwise.

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 ...

Get Intel Threading Building Blocks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.