class toSemaphore

Encapsulation of pthread semaphores. More...

Definition#include <tothread.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Encapsulation of pthread semaphores. A semaphore can be raise to any value but will wait till raised above zero when lowered below 0. Can also be implemented without pthreads using Qt multithreaded primitives. Observe that these function different than Qt semaphores.

 toSemaphore ()

toSemaphore

 toSemaphore (int val)

toSemaphore

 ~toSemaphore ()

~toSemaphore

void  up ()

up

void  down ()

down

int  getValue ()

getValue

 toSemaphore ()

toSemaphore

Create semaphore

 toSemaphore (const toSemaphore &)

toSemaphore

Unimplemented copy constructor.

 toSemaphore (int val)

toSemaphore

Create semaphore

Parameters:
valValue of new semaphore.

void  up ()

up

Increase semaphore value by 1.

void  down ()

down

Decrease semaphore value by 1, wait for it to never go below 0.

int  getValue ()

getValue

Get current semaphore value.