#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 |
Definition at line 55 of file unix/SysSemaphore.hpp.
|
inline |
Definition at line 57 of file unix/SysSemaphore.hpp.
SysSemaphore::SysSemaphore | ( | const char * | variable, |
bool | createSem | ||
) |
Create a semaphore with potential creation-time initialization.
create | Indicates whether the semaphore should be created now. |
Definition at line 78 of file unix/SysSemaphore.cpp.
References create(), created, postedCount, and semVariable.
|
inline |
Definition at line 59 of file unix/SysSemaphore.hpp.
|
inline |
Definition at line 59 of file windows/SysSemaphore.hpp.
SysSemaphore::SysSemaphore | ( | const char * | variable, |
bool | |||
) |
|
inline |
Definition at line 61 of file windows/SysSemaphore.hpp.
|
inlinestatic |
Definition at line 114 of file windows/SysSemaphore.hpp.
References tlsNoMessageLoopIndex, and usingTls.
Referenced by DllMain().
void SysSemaphore::close | ( | ) |
Definition at line 155 of file unix/SysSemaphore.cpp.
References created, semCond, and semMutex.
Referenced by RexxActivity::cleanupActivityResources(), ActivityManager::closeLocks(), InterpreterInstance::terminate(), and DataQueue::~DataQueue().
void SysSemaphore::close | ( | ) |
void SysSemaphore::create | ( | ) |
Definition at line 91 of file unix/SysSemaphore.cpp.
References created, postedCount, semCond, and semMutex.
Referenced by ActivityManager::createLocks(), DataQueue::init(), InterpreterInstance::InterpreterInstance(), RexxActivity::RexxActivity(), and SysSemaphore().
void SysSemaphore::create | ( | ) |
|
inlinestatic |
Definition at line 120 of file windows/SysSemaphore.hpp.
References tlsNoMessageLoopIndex, and usingTls.
Referenced by DllMain().
|
inlinestatic |
Definition at line 127 of file windows/SysSemaphore.hpp.
References tlsNoMessageLoopIndex, and usingTls.
Referenced by waitHandle().
|
inline |
Definition at line 61 of file unix/SysSemaphore.hpp.
|
inline |
Definition at line 63 of file windows/SysSemaphore.hpp.
void SysSemaphore::post | ( | ) |
Definition at line 166 of file unix/SysSemaphore.cpp.
References postedCount, semCond, and semMutex.
Referenced by DataQueue::checkWaiters(), InterpreterInstance::detachThread(), RexxActivity::guardPost(), InterpreterInstance::poolActivity(), RexxActivity::postDispatch(), ActivityManager::postTermination(), RexxMethod1(), RexxActivity::run(), and RexxActivity::terminatePoolActivity().
|
inline |
Definition at line 65 of file windows/SysSemaphore.hpp.
References sem.
|
inline |
Definition at line 67 of file unix/SysSemaphore.hpp.
References postedCount.
|
inline |
Definition at line 110 of file windows/SysSemaphore.hpp.
References sem.
void SysSemaphore::reset | ( | void | ) |
Definition at line 249 of file unix/SysSemaphore.cpp.
References postedCount, and semMutex.
Referenced by RexxActivity::clearWait(), ActivityManager::createLocks(), RexxActivity::guardSet(), InterpreterInstance::InterpreterInstance(), DataQueue::pullData(), RexxActivity::RexxActivity(), RexxMethod2(), RexxActivity::runThread(), and RexxActivity::waitReserve().
|
inline |
Definition at line 109 of file windows/SysSemaphore.hpp.
References sem.
|
inlinestatic |
Definition at line 126 of file windows/SysSemaphore.hpp.
References tlsNoMessageLoopIndex.
Referenced by RexxSetProcessMessages().
|
inline |
Definition at line 68 of file unix/SysSemaphore.hpp.
References semVariable.
Referenced by RexxActivity::RexxActivity().
|
inline |
Definition at line 112 of file windows/SysSemaphore.hpp.
References semVariable.
void SysSemaphore::wait | ( | const char * | ds, |
int | di | ||
) |
Definition at line 176 of file unix/SysSemaphore.cpp.
References ConcurrencyInfos::activation, CONCURRENCY_TRACE, dbgprintf(), Utilities::GetConcurrencyInfos(), ConcurrencyInfos::lock, postedCount, ConcurrencyInfos::reserveCount, semCond, semMutex, semVariable, ConcurrencyInfos::threadId, Utilities::traceConcurrency(), and ConcurrencyInfos::variableDictionary.
Referenced by RexxActivity::guardWait(), RexxMethod2(), RexxActivity::runThread(), InterpreterInstance::terminate(), DataQueue::waitForData(), RexxActivity::waitForDispatch(), ActivityManager::waitForTermination(), and RexxActivity::waitReserve().
|
inline |
Definition at line 66 of file windows/SysSemaphore.hpp.
References ConcurrencyInfos::activation, CONCURRENCY_TRACE, dbgprintf(), Utilities::GetConcurrencyInfos(), ConcurrencyInfos::lock, ConcurrencyInfos::reserveCount, sem, semVariable, ConcurrencyInfos::threadId, Utilities::traceConcurrency(), ConcurrencyInfos::variableDictionary, and waitHandle().
|
inline |
Definition at line 87 of file windows/SysSemaphore.hpp.
References ConcurrencyInfos::activation, CONCURRENCY_TRACE, dbgprintf(), Utilities::GetConcurrencyInfos(), ConcurrencyInfos::lock, ConcurrencyInfos::reserveCount, sem, semVariable, ConcurrencyInfos::threadId, Utilities::traceConcurrency(), and ConcurrencyInfos::variableDictionary.
bool SysSemaphore::wait | ( | const char * | ds, |
int | di, | ||
uint32_t | t | ||
) |
Definition at line 214 of file unix/SysSemaphore.cpp.
References ConcurrencyInfos::activation, CONCURRENCY_TRACE, dbgprintf(), Utilities::GetConcurrencyInfos(), ConcurrencyInfos::lock, postedCount, ConcurrencyInfos::reserveCount, semCond, semMutex, semVariable, ConcurrencyInfos::threadId, Utilities::traceConcurrency(), and ConcurrencyInfos::variableDictionary.
|
protected |
Definition at line 75 of file unix/SysSemaphore.hpp.
Referenced by close(), create(), and SysSemaphore().
|
protected |
Definition at line 74 of file unix/SysSemaphore.hpp.
Referenced by create(), post(), posted(), reset(), SysSemaphore(), and wait().
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 71 of file unix/SysSemaphore.hpp.
Referenced by setSemVariable(), SysSemaphore(), and wait().
|
staticprivate |
Definition at line 135 of file windows/SysSemaphore.hpp.
Referenced by allocTlsIndex(), deallocTlsIndex(), noMessageLoop(), and setNoMessageLoop().
|
staticprivate |
Definition at line 134 of file windows/SysSemaphore.hpp.
Referenced by allocTlsIndex(), deallocTlsIndex(), and noMessageLoop().