RAUL 0.8.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Raul::Semaphore Class Reference
Realtime Audio Utility Library

Counting semaphore. More...

`#include <Semaphore.hpp>`

Inherits noncopyable.

List of all members.

## Public Member Functions

| Semaphore (unsigned int initial)
void | reset (unsigned int initial)
| Destroy and reset the semaphore to an initial value.
void | post ()
| Increment (and signal any waiters).
void | wait ()
| Wait until count is > 0, then decrement.
bool | try_wait ()
| Non-blocking version of wait().

## Detailed Description

Counting semaphore.

## Member Function Documentation

void Raul::Semaphore::reset | ( | unsigned int | initial | ) | `[inline]`

Destroy and reset the semaphore to an initial value.

This must not be called while there are any waiters.

void Raul::Semaphore::post | ( |  | ) | `[inline]`

Increment (and signal any waiters).

Realtime safe.

Referenced by Raul::Slave::whip().

void Raul::Semaphore::wait | ( |  | ) | `[inline]`

Wait until count is > 0, then decrement.

Obviously not realtime safe.

bool Raul::Semaphore::try_wait | ( |  | ) | `[inline]`

Non-blocking version of wait().

Returns:
  true if decrement was successful (lock was acquired).

Realtime safe?

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

- Semaphore.hpp