| Home | Download | Screen shots | Discussion | Documentation |
|---|
#include <openvrml/read_write_mutex.h>
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... | |
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. | |
This read/write mutex is implemented in terms of boost::mutex and boost::condition.
| openvrml::read_write_mutex::read_write_mutex | ( | ) |
Construct.
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.