TC::MT::Semaphore Class Reference
[Multithreading]

counted semaphore More...

#include <TCMTSemaphore.h>

Inheritance diagram for TC::MT::Semaphore:

Inheritance graph
[legend]
Collaboration diagram for TC::MT::Semaphore:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual bool Wait ()=0
 if semaphore value is > 0 then decrement it and carry on.
virtual bool TryWait ()=0
 if semaphore value is > 0 then decrement it and return 1 (true).
virtual bool TryWait (uint32 millisecs)=0
 if semaphore value is > 0 then decrement it and return 1 (true).
virtual bool Post ()=0
 if any threads are blocked in wait(), wake one of them up.
virtual ~Semaphore ()


Detailed Description

counted semaphore

Definition at line 60 of file TCMTSemaphore.h.


Constructor & Destructor Documentation

virtual TC::MT::Semaphore::~Semaphore (  )  [inline, virtual]

Definition at line 87 of file TCMTSemaphore.h.


Member Function Documentation

virtual bool TC::MT::Semaphore::Wait (  )  [pure virtual]

if semaphore value is > 0 then decrement it and carry on.

If it's already 0 then block until > 0.

virtual bool TC::MT::Semaphore::TryWait (  )  [pure virtual]

if semaphore value is > 0 then decrement it and return 1 (true).

If it's already 0 then return 0 (false).

virtual bool TC::MT::Semaphore::TryWait ( uint32  millisecs  )  [pure virtual]

if semaphore value is > 0 then decrement it and return 1 (true).

If it's already 0 then block for maximum specified time until > 0

virtual bool TC::MT::Semaphore::Post (  )  [pure virtual]

if any threads are blocked in wait(), wake one of them up.

Otherwise increment the value of the semaphore.


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

Copyright (c) Thomas Goessler 2003 - 2008