SysSemaphore Class Reference

#include <SysSemaphore.hpp>

Public Member Functions

 SysSemaphore (const char *variable)
 
 SysSemaphore (const char *variable, bool)
 
 ~SysSemaphore ()
 
void create ()
 
void open ()
 
void close ()
 
void post ()
 
void wait (const char *ds, int di)
 
bool wait (const char *ds, int di, uint32_t)
 
void reset ()
 
bool posted ()
 
void setSemVariable (const char *variable)
 
 SysSemaphore (const char *variable)
 
 SysSemaphore (const char *variable, bool)
 
 ~SysSemaphore ()
 
void create ()
 
void open ()
 
void close ()
 
void post ()
 
void wait (const char *ds, int di)
 
bool wait (const char *ds, int di, uint32_t timeout)
 
void reset ()
 
bool posted ()
 
void setSemVariable (const char *variable)
 

Static Public Member Functions

static bool allocTlsIndex ()
 
static void deallocTlsIndex ()
 
static void setNoMessageLoop ()
 
static bool noMessageLoop ()
 

Protected Attributes

const char * semVariable
 
pthread_cond_t semCond
 
pthread_mutex_t semMutex
 
int postedCount
 
bool created
 
HANDLE sem
 

Static Private Attributes

static bool usingTls = false
 
static DWORD tlsNoMessageLoopIndex = TLS_OUT_OF_INDEXES
 

Detailed Description

Definition at line 55 of file unix/SysSemaphore.hpp.

Constructor & Destructor Documentation

◆ SysSemaphore() [1/4]

SysSemaphore::SysSemaphore ( const char *  variable)
inline

Definition at line 57 of file unix/SysSemaphore.hpp.

◆ SysSemaphore() [2/4]

SysSemaphore::SysSemaphore ( const char *  variable,
bool  createSem 
)

Create a semaphore with potential creation-time initialization.

Parameters
createIndicates whether the semaphore should be created now.

Definition at line 78 of file unix/SysSemaphore.cpp.

References create(), created, postedCount, and semVariable.

◆ ~SysSemaphore() [1/2]

SysSemaphore::~SysSemaphore ( )
inline

Definition at line 59 of file unix/SysSemaphore.hpp.

◆ SysSemaphore() [3/4]

SysSemaphore::SysSemaphore ( const char *  variable)
inline

Definition at line 59 of file windows/SysSemaphore.hpp.

◆ SysSemaphore() [4/4]

SysSemaphore::SysSemaphore ( const char *  variable,
bool   
)

◆ ~SysSemaphore() [2/2]

SysSemaphore::~SysSemaphore ( )
inline

Definition at line 61 of file windows/SysSemaphore.hpp.

Member Function Documentation

◆ allocTlsIndex()

static bool SysSemaphore::allocTlsIndex ( )
inlinestatic

Definition at line 114 of file windows/SysSemaphore.hpp.

References tlsNoMessageLoopIndex, and usingTls.

Referenced by DllMain().

◆ close() [1/2]

◆ close() [2/2]

void SysSemaphore::close ( )

◆ create() [1/2]

◆ create() [2/2]

void SysSemaphore::create ( )

◆ deallocTlsIndex()

static void SysSemaphore::deallocTlsIndex ( )
inlinestatic

Definition at line 120 of file windows/SysSemaphore.hpp.

References tlsNoMessageLoopIndex, and usingTls.

Referenced by DllMain().

◆ noMessageLoop()

static bool SysSemaphore::noMessageLoop ( )
inlinestatic

Definition at line 127 of file windows/SysSemaphore.hpp.

References tlsNoMessageLoopIndex, and usingTls.

Referenced by waitHandle().

◆ open() [1/2]

void SysSemaphore::open ( )
inline

Definition at line 61 of file unix/SysSemaphore.hpp.

◆ open() [2/2]

void SysSemaphore::open ( )
inline

Definition at line 63 of file windows/SysSemaphore.hpp.

◆ post() [1/2]

◆ post() [2/2]

void SysSemaphore::post ( )
inline

Definition at line 65 of file windows/SysSemaphore.hpp.

References sem.

◆ posted() [1/2]

bool SysSemaphore::posted ( )
inline

Definition at line 67 of file unix/SysSemaphore.hpp.

References postedCount.

◆ posted() [2/2]

bool SysSemaphore::posted ( )
inline

Definition at line 110 of file windows/SysSemaphore.hpp.

References sem.

◆ reset() [1/2]

◆ reset() [2/2]

void SysSemaphore::reset ( void  )
inline

Definition at line 109 of file windows/SysSemaphore.hpp.

References sem.

◆ setNoMessageLoop()

static void SysSemaphore::setNoMessageLoop ( )
inlinestatic

Definition at line 126 of file windows/SysSemaphore.hpp.

References tlsNoMessageLoopIndex.

Referenced by RexxSetProcessMessages().

◆ setSemVariable() [1/2]

void SysSemaphore::setSemVariable ( const char *  variable)
inline

Definition at line 68 of file unix/SysSemaphore.hpp.

References semVariable.

Referenced by RexxActivity::RexxActivity().

◆ setSemVariable() [2/2]

void SysSemaphore::setSemVariable ( const char *  variable)
inline

Definition at line 112 of file windows/SysSemaphore.hpp.

References semVariable.

◆ wait() [1/4]

◆ wait() [2/4]

◆ wait() [3/4]

◆ wait() [4/4]

Member Data Documentation

◆ created

bool SysSemaphore::created
protected

Definition at line 75 of file unix/SysSemaphore.hpp.

Referenced by close(), create(), and SysSemaphore().

◆ postedCount

int SysSemaphore::postedCount
protected

Definition at line 74 of file unix/SysSemaphore.hpp.

Referenced by create(), post(), posted(), reset(), SysSemaphore(), and wait().

◆ sem

HANDLE SysSemaphore::sem
protected

Definition at line 131 of file windows/SysSemaphore.hpp.

Referenced by post(), posted(), reset(), and wait().

◆ semCond

pthread_cond_t SysSemaphore::semCond
protected

Definition at line 72 of file unix/SysSemaphore.hpp.

Referenced by close(), create(), post(), and wait().

◆ semMutex

pthread_mutex_t SysSemaphore::semMutex
protected

Definition at line 73 of file unix/SysSemaphore.hpp.

Referenced by close(), create(), post(), reset(), and wait().

◆ semVariable

const char * SysSemaphore::semVariable
protected

Definition at line 71 of file unix/SysSemaphore.hpp.

Referenced by setSemVariable(), SysSemaphore(), and wait().

◆ tlsNoMessageLoopIndex

DWORD SysSemaphore::tlsNoMessageLoopIndex = TLS_OUT_OF_INDEXES
staticprivate

◆ usingTls

bool SysSemaphore::usingTls = false
staticprivate

Definition at line 134 of file windows/SysSemaphore.hpp.

Referenced by allocTlsIndex(), deallocTlsIndex(), and noMessageLoop().


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