45 #ifndef Included_SysSemaphore
46 #define Included_SysSemaphore
66 inline void wait(
const char *ds,
int di)
89 #ifdef CONCURRENCY_DEBUG
94 dbgprintf(
CONCURRENCY_TRACE "...... ... (SysSemaphore)%s.wait : before WaitForSingleObject(0x%x, timemout) from %s (0x%x)\n", concurrencyInfos.
threadId, concurrencyInfos.
activation, concurrencyInfos.
variableDictionary, concurrencyInfos.
reserveCount, concurrencyInfos.
lock,
semVariable,
sem, timeout, ds, di);
97 bool result = WaitForSingleObject(
sem, timeout) != WAIT_TIMEOUT;
98 #ifdef CONCURRENCY_DEBUG
103 dbgprintf(
CONCURRENCY_TRACE "...... ... (SysSemaphore)%s.wait : after WaitForSingleObject(0x%x, timemout) from %s (0x%x)\n", concurrencyInfos.
threadId, concurrencyInfos.
activation, concurrencyInfos.
variableDictionary, concurrencyInfos.
reserveCount, concurrencyInfos.
lock,
semVariable,
sem, timeout, ds, di);
110 inline bool posted() {
return WaitForSingleObject(
sem, 0) != 0; }
149 #ifdef CONCURRENCY_DEBUG
158 #ifdef CONCURRENCY_DEBUG
170 #ifdef CONCURRENCY_DEBUG
179 #ifdef CONCURRENCY_DEBUG
191 #ifdef CONCURRENCY_DEBUG
199 bool result = WaitForSingleObject(
mutexMutex, 0) != WAIT_TIMEOUT;
200 #ifdef CONCURRENCY_DEBUG
250 if ( WaitForSingleObject(s, 0) == WAIT_OBJECT_0 )
258 WaitForSingleObject(s, INFINITE);
266 while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
268 TranslateMessage(&msg);
269 DispatchMessage(&msg);
272 if ( WaitForSingleObject(s, 0) == WAIT_OBJECT_0 )
277 }
while ( MsgWaitForMultipleObjects(1, &s, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0 + 1 );
#define CONCURRENCY_TRACE
void release(const char *ds, int di)
pthread_mutex_t mutexMutex
SysMutex(const char *variable)
bool requestImmediate(const char *ds, int di)
SysMutex(const char *, bool)
const char * mutexVariable
void request(const char *ds, int di)
SysSemaphore(const char *variable)
static void setNoMessageLoop()
bool wait(const char *ds, int di, uint32_t timeout)
SysSemaphore(const char *variable, bool)
void wait(const char *ds, int di)
void setSemVariable(const char *variable)
static void deallocTlsIndex()
static bool noMessageLoop()
static DWORD tlsNoMessageLoopIndex
static bool allocTlsIndex()
static void GetConcurrencyInfos(struct ConcurrencyInfos &concurrencyInfos)
static bool traceConcurrency()
RexxVariableDictionary * variableDictionary
RexxActivation * activation
unsigned short reserveCount
void dbgprintf(const char *format,...)
void waitHandle(HANDLE s)