Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::Semaphore Class Reference

Semaphore class built around posix sem_xxx functionality. More...

#include <Semaphore.h>

Classes

class  Lock
 Locking class. More...
 

Public Member Functions

 Semaphore (int initialCount=0)
 Constructor initializing the counter.
 
 ~Semaphore ()
 Destructor cleaning up the allocated semaphore.
 
bool post ()
 Signals any thread which is locked.
 
int value () const
 Gets the semaphore integer value.
 

Protected Types

typedef sem_t handle_type
 

Protected Member Functions

void release ()
 Called by Lock destructor.
 

Protected Attributes

handle_type _handle
 Holds the semaphore handle/structure.
 

Detailed Description

Semaphore class built around posix sem_xxx functionality.

Member Typedef Documentation

◆ handle_type

typedef sem_t sf::Semaphore::handle_type
protected

Type of handle/structure referencing the semaphore.

Constructor & Destructor Documentation

◆ Semaphore()

sf::Semaphore::Semaphore ( int  initialCount = 0)
explicit

Constructor initializing the counter.

◆ ~Semaphore()

sf::Semaphore::~Semaphore ( )

Destructor cleaning up the allocated semaphore.

Member Function Documentation

◆ post()

bool sf::Semaphore::post ( )

Signals any thread which is locked.

Returns
True on success.

◆ release()

void sf::Semaphore::release ( )
protected

Called by Lock destructor.

◆ value()

int sf::Semaphore::value ( ) const

Gets the semaphore integer value.

Returns
Last value, it can be changed in the meantime.

Member Data Documentation

◆ _handle

handle_type sf::Semaphore::_handle
protected

Holds the semaphore handle/structure.


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