class GradSoft::RWLock

Read/Write lock allow multiple readers/single writer.

Public Methods

[more] RWLock() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
constructor.
[more]virtual ~RWLock() throw(ThreadingExceptions::ResourceBusy, ThreadingExceptions::InternalError)
destructor
[more]void read_lock() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
obtaine read lock.
[more]bool try_read_lock() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
try to obtain read lock.
[more]void read_unlock() const throw(ThreadingExceptions::NoPermission, ThreadingExceptions::InternalError)
unlock read lock.
[more]void write_lock() throw(ThreadingExceptions::NoMemory, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
obtaine write lock.
[more]bool try_write_lock() throw(ThreadingExceptions::NoMemory, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
try to obtain write lock.
[more]void write_unlock() const throw(ThreadingExceptions::NoPermission, ThreadingExceptions::InternalError)
unlock write lock.


Documentation

Read/Write lock allow multiple readers/single writer. access to object with such lock must be sequence of atomic read-only or write-only operations.

(i. e. rwlock.read_lock(), rwlock.write_lock() is the fastest way to deadlock state.

o RWLock() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
constructor. Create rwlock in ulocked state.

ovirtual ~RWLock() throw(ThreadingExceptions::ResourceBusy, ThreadingExceptions::InternalError)
destructor

ovoid read_lock() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
obtaine read lock. If now rwlock is write-locked, than wait until lock will be obtained.

obool try_read_lock() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
try to obtain read lock.
Returns:
s true, if lock obtained, false otherwise.

ovoid read_unlock() const throw(ThreadingExceptions::NoPermission, ThreadingExceptions::InternalError)
unlock read lock. (safe, only if lock was previously read-locked).

ovoid write_lock() throw(ThreadingExceptions::NoMemory, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
obtaine write lock. If now rwlock is locked, than wait until lock will be obtained.

obool try_write_lock() throw(ThreadingExceptions::NoMemory, ThreadingExceptions::PossibleDeadlock, ThreadingExceptions::InternalError)
try to obtain write lock.
Returns:
s true, if lock obtained, false otherwise.

ovoid write_unlock() const throw(ThreadingExceptions::NoPermission, ThreadingExceptions::InternalError)
unlock write lock. (safe, only if lock was previously write-locked).


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.