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

FX::FXSemaphore Class Reference

A semaphore allows for protection of a resource that can be accessed by a fixed number of simultaneous threads. More...

#include <FXThread.h>

List of all members.

Public Member Functions

 FXSemaphore (FXint initial=1)
void wait ()
FXbool trywait ()
void post ()
 ~FXSemaphore ()


Detailed Description

A semaphore allows for protection of a resource that can be accessed by a fixed number of simultaneous threads.


Constructor & Destructor Documentation

FX::FXSemaphore::FXSemaphore FXint  initial = 1  ) 
 

Initialize semaphore with given count.

FX::FXSemaphore::~FXSemaphore  ) 
 

Delete semaphore.


Member Function Documentation

void FX::FXSemaphore::wait  ) 
 

Decrement semaphore.

FXbool FX::FXSemaphore::trywait  ) 
 

Non-blocking semaphore decrement.

void FX::FXSemaphore::post  ) 
 

Increment semaphore.

Copyright © 1997-2005 Jeroen van der Zijp