openvrml::read_write_mutex Class Reference

#include <openvrml/read_write_mutex.h>

List of all members.


Detailed Description

A read/write mutex with an interface that follows the patterns established in the Boost thread library.

This read/write mutex is implemented in terms of boost::mutex and boost::condition.


Public Member Functions

 read_write_mutex ()
 Construct.

Private Attributes

boost::mutex mutex_
 The underlying mutex.
boost::condition read_
 When writing is done, this condition is signaled to indicate that readers can acquire the lock.
boost::condition write_
 When reading is done, this condition is signaled to indicate that a writer can acquire the lock.
std::size_t readers_active_
 The number of readers currently sharing the lock.
std::size_t readers_waiting_
 The number of readers currently waiting for the lock.
std::size_t writers_waiting_
 The number of writers currently waiting for the lock.
bool writing_
 true if a writer has the lock; false otherwise.

Classes

class  scoped_read_lock
 Lock the mutex for read access. More...
class  scoped_read_write_lock
 Lock the mutex for read/write access. More...
class  scoped_write_lock
 Lock the mutex for write access. More...

Constructor & Destructor Documentation

openvrml::read_write_mutex::read_write_mutex (  ) 

Construct.


Member Data Documentation

boost::mutex openvrml::read_write_mutex::mutex_ [private]

The underlying mutex.

For internal use only.

boost::condition openvrml::read_write_mutex::read_ [private]

When writing is done, this condition is signaled to indicate that readers can acquire the lock.

For internal use only.

boost::condition openvrml::read_write_mutex::write_ [private]

When reading is done, this condition is signaled to indicate that a writer can acquire the lock.

For internal use only.

The number of readers currently sharing the lock.

For internal use only.

The number of readers currently waiting for the lock.

For internal use only.

The number of writers currently waiting for the lock.

For internal use only.

true if a writer has the lock; false otherwise.

For internal use only.