Version: 8.3.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 ( int  initValue = 0)

Definition at line 24 of file SemaphorePT.cxx.

References _semDesc.

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

Definition at line 29 of file SemaphorePT.cxx.

References _semDesc.

30 {
31  sem_destroy(&_semDesc);
32 }

Member Function Documentation

int SemaphorePT::getValue ( )

Definition at line 44 of file SemaphorePT.cxx.

References _semDesc.

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

Definition at line 34 of file SemaphorePT.cxx.

References _semDesc.

35 {
36  sem_post(&_semDesc);
37 }
void SemaphorePT::wait ( )

Definition at line 39 of file SemaphorePT.cxx.

References _semDesc.

40 {
41  sem_wait(&_semDesc);
42 }

Member Data Documentation

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: