HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_RWLock Class Reference

Reader/Writer mutex class. More...

#include <UT_RWLock.h>

+ Inheritance diagram for UT_RWLock:

Public Types

typedef UT_AutoRWLockType
< UT_RWLock, true > 
ReadScope
 
typedef UT_AutoRWLockType
< UT_RWLock, false > 
WriteScope
 

Public Member Functions

 UT_RWLock ()
 
 ~UT_RWLock ()
 
bool tryReadLock (int ntrials=1)
 
bool tryWriteLock (int ntrials=1)
 
void readLock ()
 
void writeLock ()
 
void readUnlock ()
 Release a shared read lock. More...
 
void writeUnlock ()
 Release an exclusive write lock. More...
 

Detailed Description

Reader/Writer mutex class.

Definition at line 47 of file UT_RWLock.h.

Member Typedef Documentation

Definition at line 88 of file UT_RWLock.h.

Definition at line 89 of file UT_RWLock.h.

Constructor & Destructor Documentation

UT_RWLock::UT_RWLock ( )
UT_RWLock::~UT_RWLock ( )

Member Function Documentation

void UT_RWLock::readLock ( )

Attempt to acquire a shared read lock, blocking until the lock is acquired.

A thread holding the exclusive write lock may acquire a shared read lock as well, thereby holding both.

void UT_RWLock::readUnlock ( )

Release a shared read lock.

bool UT_RWLock::tryReadLock ( int  ntrials = 1)

Attempt to acquire a shared read lock, returning false if the shared read lock cannot be acquired immediately.

A thread holding the exclusive write lock may acquire a shared read lock as well, thereby holding both.

bool UT_RWLock::tryWriteLock ( int  ntrials = 1)

Attempt to acquire an exclusive write lock, returning false if the exclusive write lock cannot be acquired immediately.

It is an error to attempt to acquire an exclusive write lock while holding a shared read lock.

void UT_RWLock::writeLock ( )

Attempt to acquire an exclusive write lock, blocking until the lock is acquired.

It is an error to attempt to acquire an exclusive write lock while holding a shared read lock. If you're not sure whether you're holding the read lock or not, use tryWriteLock instead.

void UT_RWLock::writeUnlock ( )

Release an exclusive write lock.


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