Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

RazorBack::Condvar_ Class Reference

Class Condvar_: wrapper class for condition variables. More...

#include <MTsync.hh>

List of all members.

Public Methods

 Condvar_ ()
 Init to default.

 ~Condvar_ ()
 dtor.

void reset ()
 reset(): sets the Signal to false.

void wait ()
 wait(): locks the associated mutex, reads the condition variable, then unlocks Mutex and starts waiting on the condition.

void timed_wait (long Sec, long Nanosec)
 timed_wait(Sec, Nanosec): does the same as wait() but times out after Sec seconds and Nanosec nanoseconds have elapsed.

void signal ()
 signal(): indicates that the condition is fulfilled and one thread waiting on the condition variable can be unblocked.

void broadcast ()
 broadcast(): indicates that the condition is fulfilled and all threads waiting on the condition variable may be unblocked.


Private Methods

 Condvar_ (const Condvar_ &)
Condvar_& operator= (const Condvar_ &)

Private Attributes

pthread_cond_t Cond
 the condition variable.

pthread_mutex_t Mtx
 the associated mutex.

bool Signal
 true if somebody signalled.


Detailed Description

Class Condvar_: wrapper class for condition variables.

Definition at line 87 of file MTsync.hh.


Constructor & Destructor Documentation

RazorBack::Condvar_::Condvar_ ( ) [inline]
 

Init to default.

Definition at line 100 of file MTsync.hh.

RazorBack::Condvar_::~Condvar_ ( ) [inline]
 

dtor.

Definition at line 107 of file MTsync.hh.

RazorBack::Condvar_::Condvar_ ( const Condvar_ & ) [private]
 


Member Function Documentation

void RazorBack::Condvar_::reset ( )
 

reset(): sets the Signal to false.

void RazorBack::Condvar_::wait ( )
 

wait(): locks the associated mutex, reads the condition variable, then unlocks Mutex and starts waiting on the condition.

void RazorBack::Condvar_::timed_wait ( long Sec,
long Nanosec )
 

timed_wait(Sec, Nanosec): does the same as wait() but times out after Sec seconds and Nanosec nanoseconds have elapsed.

void RazorBack::Condvar_::signal ( )
 

signal(): indicates that the condition is fulfilled and one thread waiting on the condition variable can be unblocked.

void RazorBack::Condvar_::broadcast ( )
 

broadcast(): indicates that the condition is fulfilled and all threads waiting on the condition variable may be unblocked.

Condvar_& RazorBack::Condvar_::operator= ( const Condvar_ & ) [private]
 


Member Data Documentation

pthread_cond_t RazorBack::Condvar_::Cond [private]
 

the condition variable.

Definition at line 92 of file MTsync.hh.

pthread_mutex_t RazorBack::Condvar_::Mtx [private]
 

the associated mutex.

Definition at line 93 of file MTsync.hh.

bool RazorBack::Condvar_::Signal [private]
 

true if somebody signalled.

Definition at line 94 of file MTsync.hh.


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:34 2002 for The Razorback C++ Library: POSIX Thread Wrappers by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001