Poco::RWLock Class Reference

#include <RWLock.h>

Inheritance diagram for Poco::RWLock:

Inheritance graph
[legend]
Collaboration diagram for Poco::RWLock:

Collaboration graph
[legend]

Detailed Description

A reader writer lock allows multiple concurrent readers or one exclusive writer.

Definition at line 90 of file RWLock.h.


Public Types

typedef ScopedRWLock ScopedLock

Public Member Functions

 RWLock ()
 ~RWLock ()
 Creates the Reader/Writer lock.
void readLock ()
 Destroys the Reader/Writer lock.
bool tryReadLock ()
 Acquires a read lock. If another thread currently holds a write lock, waits until the write lock is released.
void writeLock ()
 Tries to acquire a read lock. Immediately returns true if successful, or false if another thread currently holds a write lock.
bool tryWriteLock ()
 Acquires a write lock. If one or more other threads currently hold locks, waits until all locks are released. The results are undefined if the same thread already holds a read or write lock.
void unlock ()
 Tries to acquire a write lock. Immediately returns true if successful, or false if one or more other threads currently hold locks. The result is undefined if the same thread already holds a read or write lock.

Private Member Functions

 RWLock (const RWLock &)
 Releases the read or write lock.
RWLockoperator= (const RWLock &)

Member Typedef Documentation

Definition at line 95 of file RWLock.h.


Constructor & Destructor Documentation

Poco::RWLock::RWLock (  ) 

Definition at line 80 of file RWLock.cpp.

Poco::RWLock::~RWLock (  ) 

Creates the Reader/Writer lock.

Definition at line 85 of file RWLock.cpp.

Poco::RWLock::RWLock ( const RWLock  )  [private]

Releases the read or write lock.


Member Function Documentation

void Poco::RWLock::readLock (  )  [inline]

Destroys the Reader/Writer lock.

Definition at line 150 of file RWLock.h.

References Poco::RWLockImpl::readLockImpl().

Referenced by Poco::ScopedRWLock::ScopedRWLock().

bool Poco::RWLock::tryReadLock (  )  [inline]

Acquires a read lock. If another thread currently holds a write lock, waits until the write lock is released.

Definition at line 156 of file RWLock.h.

References Poco::RWLockImpl::tryReadLockImpl().

void Poco::RWLock::writeLock (  )  [inline]

Tries to acquire a read lock. Immediately returns true if successful, or false if another thread currently holds a write lock.

Definition at line 162 of file RWLock.h.

References Poco::RWLockImpl::writeLockImpl().

Referenced by Poco::ScopedRWLock::ScopedRWLock().

bool Poco::RWLock::tryWriteLock (  )  [inline]

Acquires a write lock. If one or more other threads currently hold locks, waits until all locks are released. The results are undefined if the same thread already holds a read or write lock.

Definition at line 168 of file RWLock.h.

References Poco::RWLockImpl::tryWriteLockImpl().

void Poco::RWLock::unlock (  )  [inline]

Tries to acquire a write lock. Immediately returns true if successful, or false if one or more other threads currently hold locks. The result is undefined if the same thread already holds a read or write lock.

Definition at line 174 of file RWLock.h.

References Poco::RWLockImpl::unlockImpl().

Referenced by Poco::ScopedRWLock::~ScopedRWLock().

RWLock& Poco::RWLock::operator= ( const RWLock  )  [private]


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

SourceForge.net Logo
Project space on SourceForge.net