SourceForge.net Logo

DAQpp::Semaphore Class Reference

class Semaphore. More...

#include <Thread.h>

List of all members.

Public Member Functions

 Semaphore (int ifirst)
 Constructor.
 ~Semaphore ()
 Destructor.
int wait (bool block=true)
 Waits untils the sempahore value is not 0.
void post ()
 increases the semaphore count
int count ()
 returns the value of the semaphore count

Private Attributes

sem_t _sem
 The semaphore we are wrapping.


Detailed Description

class Semaphore.

Member Function Documentation

int Semaphore::wait ( bool  block = true  ) 

Waits untils the sempahore value is not 0.

It will decrease the semaphore count on exit.

Parameters:
block if false it is a non-blocking call, otherwise it will block.
Returns:
if in non blocking mode it will return 1 value if the semaphore has a 0 count, 0 if the value could be decreased and -1 in case of error. In blocking mode it will return 0 in case of success and -1 in case of problems

References _sem.


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

Generated on Mon Apr 21 10:00:05 2008 for DAQ++ by  doxygen 1.5.5