Skip to Main Content
Intel Threading Building Blocks
book

Intel Threading Building Blocks

by James Reinders
July 2007
Intermediate to advanced content levelIntermediate to advanced
332 pages
10h 4m
English
O'Reilly Media, Inc.
Content preview from Intel Threading Building Blocks

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Intel® Xeon Phi™ Coprocessor Architecture and Tools: The Guide for Application Developers

Rezaur Rahman

Publisher Resources

ISBN: 9780596514808Errata Page