# class toSemaphore

Encapsulation of pthread semaphores. More...

Definition | `#include <tothread.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- toSemaphore ()
- toSemaphore (const toSemaphore &)
- toSemaphore (int val)
- void up ()
- void down ()
- int getValue ()
- toSemaphore ()
- toSemaphore (int val)
- ~toSemaphore ()
- void up ()
- void down ()
- int getValue ()

## 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 (const toSemaphore &)

### toSemaphore

toSemaphore (int val)

### toSemaphore

void up ()

### up

void down ()

### down

int getValue ()

### getValue

toSemaphore ()

### toSemaphore

Create semaphore

toSemaphore (int val)

### toSemaphore

Create semaphore

Parameters:

val | Value of new semaphore.

~toSemaphore ()

### ~toSemaphore

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.