cpp-pthread  (v1.7.3)
Simple C++ wrapper to pthread functions.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
pthread::write_lock Class Reference

#include <read_write_lock.hpp>

Inheritance diagram for pthread::write_lock:
pthread::read_lock

Public Member Functions

void lock ()
 
void try_lock ()
 
 write_lock ()
 
virtual ~write_lock ()
 
- Public Member Functions inherited from pthread::read_lock
void lock ()
 
void try_lock ()
 
void unlock ()
 
virtual ~read_lock ()
 

Additional Inherited Members

- Protected Member Functions inherited from pthread::read_lock
 read_lock ()
 
- Protected Attributes inherited from pthread::read_lock
pthread_rwlock_t _rwlock
 

Detailed Description

This class acquires the read/write write lock

Author
herbert koelman (herbe.nosp@m.rt.k.nosp@m.oelma.nosp@m.n@me.nosp@m..com)
Since
v1.6.0

Definition at line 85 of file read_write_lock.hpp.

Constructor & Destructor Documentation

pthread::write_lock::write_lock ( )

Constructor/Desctructor

this constructor shall allocate any resources required to use the read-write lock referenced by rwlock and initializes the lock to an unlocked state. The read/write lock passes NULL attributes. This means default behavior.

Exceptions
read_write_lock_exceptionif error conditions preventing this method to succeed.

Definition at line 21 of file read_write_lock.cpp.

pthread::write_lock::~write_lock ( )
virtual

the descructor, shall destroy the read-write lock object referenced by rwlock and release any resources used by the lock.

Definition at line 26 of file read_write_lock.cpp.

Member Function Documentation

void pthread::write_lock::lock ( )

The method apply a write lock.

The calling thread acquires the write lock if no other thread (reader or writer) holds the read-write lock. Otherwise, the thread shall block until it can acquire the lock. The calling thread may deadlock if at the time the call is made it holds the read-write lock (whether a read or write lock).

Definition at line 7 of file read_write_lock.cpp.

void pthread::write_lock::try_lock ( )

The method shall apply a write lock, if any thread currently holds the lock (for reading or writing) the method throws an exception.

See also
lock

Definition at line 14 of file read_write_lock.cpp.


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