45 #ifndef Included_SysSemaphore
46 #define Included_SysSemaphore
66 inline void wait(
const char *ds,
int di)
81 #ifdef CONCURRENCY_DEBUG
83 dbgprintf(
"(SysSemaphore)%s.wait : before WaitForSingleObject(0x%x, timemout) from %s (0x%x)\n",
semVariable,
sem, timeout, ds, di);
85 bool result = WaitForSingleObject(
sem, timeout) != WAIT_TIMEOUT;
86 #ifdef CONCURRENCY_DEBUG
88 dbgprintf(
"(SysSemaphore)%s.wait : after WaitForSingleObject(0x%x, timemout) from %s (0x%x)\n",
semVariable,
sem, timeout, ds, di);
94 inline bool posted() {
return WaitForSingleObject(
sem, 0) != 0; }
133 #ifdef CONCURRENCY_DEBUG
138 #ifdef CONCURRENCY_DEBUG
146 #ifdef CONCURRENCY_DEBUG
151 #ifdef CONCURRENCY_DEBUG
159 #ifdef CONCURRENCY_DEBUG
163 bool result = WaitForSingleObject(
mutexMutex, 0) != WAIT_TIMEOUT;
164 #ifdef CONCURRENCY_DEBUG
210 if ( WaitForSingleObject(s, 0) == WAIT_OBJECT_0 )
218 WaitForSingleObject(s, INFINITE);
226 while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
228 TranslateMessage(&msg);
229 DispatchMessage(&msg);
232 if ( WaitForSingleObject(s, 0) == WAIT_OBJECT_0 )
237 }
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 wholenumber_t currentThreadId()
static bool traceConcurrency()
void dbgprintf(const char *format,...)
void waitHandle(HANDLE s)