Home | Download | Screen shots | Discussion | Documentation
--- | --- | --- | --- | ---

- Main Page
- Namespaces
- Classes
- Files
- Related Pages
- Examples

- Class List
- Class Hierarchy
- Class Members

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

std::size_t openvrml::read_write_mutex::readers_active_ `[private]`

The number of readers currently sharing the lock.

For internal use only.

std::size_t openvrml::read_write_mutex::readers_waiting_ `[private]`

The number of readers currently waiting for the lock.

For internal use only.

std::size_t openvrml::read_write_mutex::writers_waiting_ `[private]`

The number of writers currently waiting for the lock.

For internal use only.

bool openvrml::read_write_mutex::writing_ `[private]`

`true` if a writer has the lock; `false` otherwise.

For internal use only.