openvrml::read_write_mutex::scoped_read_write_lock Class Reference

#include <openvrml/read_write_mutex.h>

Inheritance diagram for openvrml::read_write_mutex::scoped_read_write_lock:

Inheritance graph
[legend]

List of all members.


Detailed Description

Lock the mutex for read/write access.

Upon construction, the associated mutex is locked for reading. The lock can be “promoted” to a write lock by calling promote.


Public Member Functions

 scoped_read_write_lock (read_write_mutex &mutex)
 Construct.
 ~scoped_read_write_lock ()
 Destroy.
void promote ()
 Promote the lock to a write lock.
void demote ()
 Demote the lock from a write lock back to a read lock.

Constructor & Destructor Documentation

openvrml::read_write_mutex::scoped_read_write_lock::scoped_read_write_lock ( read_write_mutex mutex  )  [explicit]

Construct.

Parameters:
[in] mutex a read_write_mutex.

openvrml::read_write_mutex::scoped_read_write_lock::~scoped_read_write_lock (  ) 

Destroy.


Member Function Documentation

void openvrml::read_write_mutex::scoped_read_write_lock::promote (  ) 

Promote the lock to a write lock.

void openvrml::read_write_mutex::scoped_read_write_lock::demote (  ) 

Demote the lock from a write lock back to a read lock.

If the lock has not previously been promoted, this function has no effect.