Public Member Functions

cmtk::ThreadSemaphore Class Reference
[cmtkSystem Library]

Semaphore for thread synchronization. More...

#include <cmtkThreadSemaphore.h>

Inheritance diagram for cmtk::ThreadSemaphore:
Inheritance graph
[legend]
Collaboration diagram for cmtk::ThreadSemaphore:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ThreadSemaphore (const unsigned int initial=0)
 Initialize semaphore.
 ~ThreadSemaphore ()
 Destroy semaphore object.
void Post (const unsigned int increment=1)
 Post semaphore.
void Wait ()
 Wait for semaphore.

Detailed Description

Semaphore for thread synchronization.

Because apparently Apple engineers are incapable of implementing an interface for unnamed semaphores as provided by <semaphore.h>, we are building the semaphore ourselves on the Mac OS platform using a mutex and a condition variable.

Definition at line 62 of file cmtkThreadSemaphore.h.


Constructor & Destructor Documentation

cmtk::ThreadSemaphore::ThreadSemaphore ( const unsigned int  initial = 0 )

Initialize semaphore.

Definition at line 51 of file cmtkThreadSemaphore.cxx.

cmtk::ThreadSemaphore::~ThreadSemaphore (  )

Destroy semaphore object.

Definition at line 54 of file cmtkThreadSemaphore.cxx.


Member Function Documentation

void cmtk::ThreadSemaphore::Post ( const unsigned int  increment = 1 )

Post semaphore.

Definition at line 58 of file cmtkThreadSemaphore.cxx.

Referenced by cmtk::ThreadPool::EndThreads(), and cmtk::ThreadPool::ThreadFunction().

void cmtk::ThreadSemaphore::Wait (  )

Wait for semaphore.

Definition at line 62 of file cmtkThreadSemaphore.cxx.

Referenced by cmtk::ThreadPool::ThreadFunction().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines