All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
server::RWLock Class Reference

A Read-Write lock object. More...

#include <sync.h>

Public Member Functions

void rLock ()
 
void rUnlock ()
 
void wLock ()
 
void wUnlock ()
 

Detailed Description

A Read-Write lock object.

Simple implementation of the Readers-Writers problem, with priority to readers. A number of readers can obtain the rlock at the same time, while only one writer can obtain the wlock, and only if no writer has a wlock.

Member Function Documentation

void RWLock::rLock ( )

Require the read-lock and stop the calling thread if another thread owns a write-lock.

void RWLock::rUnlock ( )

Release the read-lock and if the calling thread is the last reader unlock the writers (if any).

void RWLock::wLock ( )

Require the write-lock and stop the calling thread if another thread owns a read or a write lock.

void RWLock::wUnlock ( )

Release the write-lock and allow the access to other threads.


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