MeVisLab Toolbox Reference
asio::Semaphore Class Referencefinal

A simple semaphore with increment and decrement functionality. More...

#include <Semaphore.h>

Public Member Functions

 Semaphore ()
 
 ~Semaphore ()
 
void increment ()
 
void decrement ()
 

Detailed Description

A simple semaphore with increment and decrement functionality.

Its destruction will wait until the usage count is zero.

Synopsis:

// This will produce a deadlock
{
asio::Semaphore semaphore;
semaphore.increment();
} // The semaphore object's destructor waits until usage is zero again (decrement() call),
// but it won't happen in this scenario.
{
asio::Semaphore semaphore;
semaphore.increment();
semaphore.decrement();
} // Now the semaphore has usage count zero, it will be destroyed.
A simple semaphore with increment and decrement functionality.
Definition: Semaphore.h:40

Definition at line 39 of file Semaphore.h.

Constructor & Destructor Documentation

◆ Semaphore()

asio::Semaphore::Semaphore ( )

◆ ~Semaphore()

asio::Semaphore::~Semaphore ( )

Member Function Documentation

◆ decrement()

void asio::Semaphore::decrement ( )

◆ increment()

void asio::Semaphore::increment ( )

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