class VRWLock

Read/write lock

Public Methods

void ReadLock()
Obtain the read lock
void Unlock()
Unlocks either the read or write lock
VRWLock()
Create a lock
void WriteLock()
Obtain the write lock
~VRWLock()
Destroy the lock

Private Fields

VMutex myMutex
Access to the lock is synchronous
VCondition myPendingWriteCondition
Pending writers will block while while waiting for the writer to finish
u_int32_t myPendingWriterCount
We can have many pending writers
VCondition myReadCondition
Readers will block until all writers have completed
u_int32_t myReaderCount
We can have multiple readers blocking
bool myWriterHasLock
We can have only a single writer

Documentation

Read/write lock. Allows serialized write access and concurrent read access.
VRWLock()
Create a lock

~VRWLock()
Destroy the lock

void ReadLock()
Obtain the read lock. This will block until all writers have completed.

void WriteLock()
Obtain the write lock. Provides serialized writing.

void Unlock()
Unlocks either the read or write lock

VMutex myMutex
Access to the lock is synchronous

VCondition myReadCondition
Readers will block until all writers have completed

VCondition myPendingWriteCondition
Pending writers will block while while waiting for the writer to finish

u_int32_t myReaderCount
We can have multiple readers blocking

bool myWriterHasLock
We can have only a single writer

u_int32_t myPendingWriterCount
We can have many pending writers


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++