CConditionalNamedSemaphorePostAtDestruction Class Reference

#include <Semaphore.H>

Inheritance diagram for CConditionalNamedSemaphorePostAtDestruction:

Inheritance graph
[legend]
Collaboration diagram for CConditionalNamedSemaphorePostAtDestruction:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 CConditionalNamedSemaphorePostAtDestruction (CNamedSemaphore &mySem, const bool initial_condition)
 ~CConditionalNamedSemaphorePostAtDestruction ()
void set_condition (const bool new_condition=true)

Private Attributes

CNamedSemaphoreSem
bool condition


Detailed Description

The CConditionalNamedSemaphorePostAtDestruction registers a semaphore on construction and unlocks it at destruction, iff (that is: if and only if) it has been said to do so. It can be used to guarantee, that the registered semaphore is unlocked after the critical section protected by this semaphore is left (regardless, whether by a normal ending of the block, a return call or because an exception is thrown).

Definition at line 147 of file Semaphore.H.


Constructor & Destructor Documentation

CConditionalNamedSemaphorePostAtDestruction::CConditionalNamedSemaphorePostAtDestruction ( CNamedSemaphore mySem,
const bool  initial_condition 
) [inline]

Definition at line 153 of file Semaphore.H.

CConditionalNamedSemaphorePostAtDestruction::~CConditionalNamedSemaphorePostAtDestruction (  )  [inline]

Definition at line 155 of file Semaphore.H.

References condition, CNamedSemaphore::post(), and Sem.

Here is the call graph for this function:


Member Function Documentation

void CConditionalNamedSemaphorePostAtDestruction::set_condition ( const bool  new_condition = true  )  [inline]

Definition at line 156 of file Semaphore.H.

References condition.

Referenced by elliptic_curves::go().


Member Data Documentation

CNamedSemaphore& CConditionalNamedSemaphorePostAtDestruction::Sem [private]

Definition at line 150 of file Semaphore.H.

Referenced by ~CConditionalNamedSemaphorePostAtDestruction().

bool CConditionalNamedSemaphorePostAtDestruction::condition [private]

Definition at line 151 of file Semaphore.H.

Referenced by set_condition(), and ~CConditionalNamedSemaphorePostAtDestruction().


The documentation for this class was generated from the following file:
Generated on Wed Nov 7 23:30:45 2007 for Qsieve by  doxygen 1.5.4