Public Member Functions

Celartem::RWLock Class Reference

#include <cel_rwlock.h>

List of all members.

Public Member Functions

 RWLock ()
 RWLock (ReaderWriterLock &rwlock, bool writeLock=false)
 RWLock (RWLock &rl)
RWLockoperator= (RWLock &rl)
virtual ~RWLock ()
void lock (ReaderWriterLock &rwlock, bool writeLock=false)
void unlock ()
void swap (RWLock &r)

Detailed Description

This class is to lock ReaderWriterLock instances.

See also:
ReaderLock, WriterLock, ReaderWriterLock

Constructor & Destructor Documentation

Celartem::RWLock::RWLock (  )  [inline]

It does not take any parameter.

Celartem::RWLock::RWLock ( ReaderWriterLock rwlock,
bool  writeLock = false 
) [inline]

This constructor creates either of Writer or Reader lock instance and also lock the specified ReaderWriterLock instance.

Parameters:
rwlock ReaderWriterLock class instance.
writeLock true to do writer lock, otherwise do reader lock.
Celartem::RWLock::RWLock ( RWLock rl  )  [inline]

This constructor duplicates the RWLock itself. Please note that if the Writer-Lock is duplicated, causes a dead-lock because ReaderWriterLock usually could not accept two Writers.

Parameters:
rl RWLock class instance.
virtual Celartem::RWLock::~RWLock (  )  [inline, virtual]

This method also releases the last lock.


Member Function Documentation

void Celartem::RWLock::lock ( ReaderWriterLock rwlock,
bool  writeLock = false 
) [inline]

This method locks the specified ReaderWriterLock instance.

Parameters:
rwlock The instance to lock.
writeLock true to do writer lock, otherwise do reader lock.

Referenced by operator=(), and RWLock().

RWLock& Celartem::RWLock::operator= ( RWLock rl  )  [inline]

This constructor duplicates the RWLock itself. Please note that if the Writer-Lock is duplicated, causes a dead-lock because ReaderWriterLock usually could not accept two Writers.

Parameters:
rl RWLock class instance.
void Celartem::RWLock::swap ( RWLock r  )  [inline]

This method swaps the locking status each other.

Parameters:
r A RWLock instance with which exchange the locking status.
void Celartem::RWLock::unlock (  )  [inline]

This method releases the last lock.

Referenced by lock(), and ~RWLock().


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

This document is made with doxygen 1.7.1 at Sat Mar 31 2012 04:35:57.
Caminova Logo