vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::MTReadWriteLockEx Class Reference

#include <MTLock.h>

Public Member Functions

 MTReadWriteLockEx ()
 
 ~MTReadWriteLockEx ()
 
bool lockRead (DWORD Timeout=INFINITE)
 
bool lockWrite (DWORD Timeout=INFINITE)
 
void unlockRead (DWORD Timeout=INFINITE)
 
void unlockWrite (DWORD Timeout=INFINITE)
 

Detailed Description

MTReadWriteLockEx is more sofisticated read/write mutex. It is recursive and upgradable.

That is, a thread can acquire and release read and write locks in arbitrary order The only rule is that every successfully acquired lock must be eventually released

E.g. LockRead(), LockWrite(), UnlockRead(), UnlockWrite() is allowed sequence.

MTReadWriteLockEx prefers writers over readers. E.g., when a writer is waiting for the lock, no new readers can acquire the lock. Existing readers may continue to use the lock. This policy prevents so-called "writer starvation" when writers never get access to the lock because of too much readers.

Constructor & Destructor Documentation

vrecko::MTReadWriteLockEx::MTReadWriteLockEx ( )
vrecko::MTReadWriteLockEx::~MTReadWriteLockEx ( )

Member Function Documentation

MTLOCK_IMP_EXP bool vrecko::MTReadWriteLockEx::lockRead ( DWORD  Timeout = INFINITE)
MTLOCK_IMP_EXP bool vrecko::MTReadWriteLockEx::lockWrite ( DWORD  Timeout = INFINITE)
MTLOCK_IMP_EXP void vrecko::MTReadWriteLockEx::unlockRead ( DWORD  Timeout = INFINITE)
MTLOCK_IMP_EXP void vrecko::MTReadWriteLockEx::unlockWrite ( DWORD  Timeout = INFINITE)

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