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

lfc::Semaphore Class Reference

Inheritance diagram for lfc::Semaphore::

lfc::Object List of all members.

Public Methods

 Semaphore (long count=1)
virtual ~Semaphore () throw ()
virtual void wait ()
 waits for the semaphore to become available. If the semaphore's count is 0, it blocks. Otherwise, it decrements the count and returns. More...

virtual bool tryWait ()
 checks for the availability of the semaphore. Doesn't block, but treats the semaphore count just like wait() does. More...

virtual void post ()
 increments the semaphore's count. More...


Protected Attributes

pal::threads::SemHandle m_handle

Detailed Description

Todo:
make this thread safe


Constructor & Destructor Documentation

lfc::Semaphore::Semaphore long    count = 1
 

lfc::Semaphore::~Semaphore   throw () [virtual]
 


Member Function Documentation

void lfc::Semaphore::wait   [virtual]
 

waits for the semaphore to become available. If the semaphore's count is 0, it blocks. Otherwise, it decrements the count and returns.

bool lfc::Semaphore::tryWait   [virtual]
 

checks for the availability of the semaphore. Doesn't block, but treats the semaphore count just like wait() does.

Returns:
semaphore was available.

void lfc::Semaphore::post   [virtual]
 

increments the semaphore's count.


Member Data Documentation

pal::threads::SemHandle lfc::Semaphore::m_handle [protected]
 

Todo:
fixme!


The documentation for this class was generated from the following files:
Generated on Fri Jan 25 03:13:47 2002 for LFC2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001