Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Menge::ReadersWriterLock Class Reference

The definition of a readers-writer lock. More...

#include <ReadersWriterLock.h>

Public Member Functions

 ReadersWriterLock ()
 Constructor.
 
virtual ~ReadersWriterLock ()
 Destructor.
 
void lockRead () const
 Requests access to read a resource. When this function returns, the resource will be safe to read. The calling thread must call releaseRead otherwise deadlocks may occur.
 
void releaseRead () const
 Releases the lock for reading. This must only be called by threads which had previously successfully called lockRead.
 
void lockWrite () const
 Requests access to write a resource. When this function returns, the resource will be safe to write. The calling thread must call releaseWrite otherwise deadlocks will occur.
 
void releaseWrite () const
 Releases the lock for writing. This must only be called by threads which had previously successfully called lockWrite.
 

Detailed Description

The definition of a readers-writer lock.

A readers-writer lock can be used to secure a resource for concurrent usage such that multiple readers can safely utilize the resource but writing tasks must have sole access.


The documentation for this class was generated from the following files: