Version: 9.16.0
YACS::BASES::SemaphorePT Class Reference

#include <SemaphorePT.hxx>

Collaboration diagram for YACS::BASES::SemaphorePT:

Public Member Functions

 SemaphorePT (int initValue=0)
 
 ~SemaphorePT ()
 
void post ()
 
void wait ()
 
int getValue ()
 

Private Attributes

sem_t _semDesc
 

Detailed Description

Definition at line 31 of file SemaphorePT.hxx.

Constructor & Destructor Documentation

◆ SemaphorePT()

SemaphorePT::SemaphorePT ( int  initValue = 0)

Definition at line 24 of file SemaphorePT.cxx.

25{
26 sem_init(&_semDesc, 0, initValue);
27}

References _semDesc.

◆ ~SemaphorePT()

SemaphorePT::~SemaphorePT ( )

Definition at line 29 of file SemaphorePT.cxx.

30{
31 sem_destroy(&_semDesc);
32}

References _semDesc.

Member Function Documentation

◆ getValue()

int SemaphorePT::getValue ( )

Definition at line 44 of file SemaphorePT.cxx.

45{
46 int val;
47 sem_getvalue(&_semDesc,&val);
48 return val;
49}

References _semDesc.

◆ post()

void SemaphorePT::post ( )

Definition at line 34 of file SemaphorePT.cxx.

35{
36 sem_post(&_semDesc);
37}

References _semDesc.

◆ wait()

void SemaphorePT::wait ( )

Definition at line 39 of file SemaphorePT.cxx.

40{
41 sem_wait(&_semDesc);
42}

References _semDesc.

Member Data Documentation

◆ _semDesc

sem_t YACS::BASES::SemaphorePT::_semDesc
private

Definition at line 40 of file SemaphorePT.hxx.

Referenced by getValue(), post(), SemaphorePT(), wait(), and ~SemaphorePT().


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