Bayonne2 / Common C++ 2 Framework
Public Member Functions | Private Attributes
ThreadLock Class Reference

The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not. More...

#include <thread.h>

Inheritance diagram for ThreadLock:
Inheritance graph
[legend]
Collaboration diagram for ThreadLock:
Collaboration graph
[legend]

Public Member Functions

  ThreadLock ()
  Create a process shared thread lock object. More...
 
virtual  ~ThreadLock ()
  Destroy a process shared thread lock object. More...
 
void  readLock (void)
  Aquire a read lock for the current object. More...
 
void  writeLock (void)
  Aquire a write lock for the current object. More...
 
bool  tryReadLock (void)
  Attempt read lock for current object. More...
 
bool  tryWriteLock (void)
  Attempt write lock for current object. More...
 
void  unlock (void)
  Release any held locks. More...
 

Private Attributes

 

Detailed Description

The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not.

Author
David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m Posix rwlock extension for protected access.

Definition at line 357 of file thread.h.

Constructor & Destructor Documentation

ThreadLock::ThreadLock ( )

Create a process shared thread lock object.

virtual ThreadLock::~ThreadLock ( )
virtual

Destroy a process shared thread lock object.

Member Function Documentation

void ThreadLock::readLock ( void  )

Aquire a read lock for the current object.

bool ThreadLock::tryReadLock ( void  )

Attempt read lock for current object.

Returns
true on success.
bool ThreadLock::tryWriteLock ( void  )

Attempt write lock for current object.

Returns
true on success.
void ThreadLock::unlock ( void  )

Release any held locks.

void ThreadLock::writeLock ( void  )

Aquire a write lock for the current object.

Field Documentation

Mutex ThreadLock::mutex
private

Definition at line 363 of file thread.h.


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

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /