Public Member Functions | List of all members
Celartem::RWLock Class Reference

#include <cel_rwlock.h>

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
rwlockReaderWriterLock class instance.
writeLocktrue 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
rlRWLock class instance.
virtual Celartem::RWLock::~RWLock ( )
inlinevirtual

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
rwlockThe instance to lock.
writeLocktrue 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
rlRWLock class instance.
void Celartem::RWLock::swap ( RWLock r)
inline

This method swaps the locking status each other.

Parameters
rA 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:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo