Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MNSem Class Reference

#include <MNSem.h>

Inheritance diagram for MNSem:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MNSem ()
 ~MNSem ()
void signal ()
void broadcast ()
void wait (MNMutex &m)
int timedwait (MNMutex &m, const struct timespec *abstime)

Protected Member Functions

bool do_attr_init ()
bool do_init ()
bool do_destroy ()
bool do_attr_destroy ()
bool do_signal ()
bool do_broadcast ()
bool do_wait (MNMutex &m)
bool do_timedwait (MNMutex &m, const struct timespec *to)

Protected Attributes

mnthread_condattr_t _attr
mnthread_cond_t _ctr

Constructor & Destructor Documentation

MNSem::MNSem  ) 
 

MNSem::~MNSem  ) 
 


Member Function Documentation

void MNSem::broadcast  ) 
 

Unblocks a condition variable. If no thread is waiting for the condition variable, nothing happens. Otherwise all waiting threads are unblocked and compete for the given mutex(es).

Reimplemented in MNSemDebug.

bool MNSem::do_attr_destroy  )  [inline, protected]
 

bool MNSem::do_attr_init  )  [inline, protected]
 

bool MNSem::do_broadcast  )  [inline, protected]
 

bool MNSem::do_destroy  )  [inline, protected]
 

bool MNSem::do_init  )  [inline, protected]
 

bool MNSem::do_signal  )  [inline, protected]
 

bool MNSem::do_timedwait MNMutex m,
const struct timespec *  to
[inline, protected]
 

bool MNSem::do_wait MNMutex m  )  [inline, protected]
 

void MNSem::signal  ) 
 

Unblocks a condition variable. If no thread is waiting for the condition variable, nothing happens. Otherwise one (AIX: at least one) (Linux: exactly one) thread is unblocked.

Reimplemented in MNSemDebug.

int MNSem::timedwait MNMutex m,
const struct timespec *  abstime
 

Unlock the given mutex and wait until the the condition variable is unblocked or until a timeout occurs. Than try to lock the mutex again.

Parameters:
m A mutex that must be locked by the calling thread.
abstime A pointer to a nano-second granularity structure that provides a timeout
Returns:
The mnthread_cond_timedwait-functions error, directly passed through to the caller, to allow checking for the ETIMEDOUT error, which indicates an expired timer.

void MNSem::wait MNMutex m  ) 
 

Unlock the given mutex and wait until the the condition variable is unblocked. Than try to lock the mutex again.

Parameters:
m A mutex that must be locked by the calling thread.

Reimplemented in MNSemDebug.


Member Data Documentation

mnthread_condattr_t MNSem::_attr [protected]
 

mnthread_cond_t MNSem::_ctr [protected]
 


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 13:36:02 2005 for Komssys by doxygen 1.3.8