Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
OSSem Class Reference

This class provides a counting semaphore API. More...

#include <OS.hxx>

Inheritance diagram for OSSem:
QListProtectedWait< items >

Public Member Functions

 OSSem (unsigned int value=0)
 Initialize a Semaphore.
 
void post ()
 Post (increment) a semaphore.
 
void wait ()
 Wait on (decrement) a semaphore.
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (OSSem)
 

Private Attributes

os_sem_t handle
 Private semaphore handle.
 

Detailed Description

This class provides a counting semaphore API.

Definition at line 242 of file OS.hxx.

Constructor & Destructor Documentation

◆ OSSem()

OSSem::OSSem ( unsigned int  value = 0)
inline

Initialize a Semaphore.

Parameters
valueinitial count

Definition at line 248 of file OS.hxx.

◆ ~OSSem()

OSSem::~OSSem ( )
inline

Definition at line 253 of file OS.hxx.

Member Function Documentation

◆ post()

void OSSem::post ( )
inline

Post (increment) a semaphore.

Definition at line 260 of file OS.hxx.

◆ wait()

void OSSem::wait ( )
inline

Wait on (decrement) a semaphore.

Definition at line 279 of file OS.hxx.

Member Data Documentation

◆ handle

os_sem_t OSSem::handle
private

Private semaphore handle.

Definition at line 299 of file OS.hxx.


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