26 static int plasmawinthread_initialized = 0;
29 return GetCurrentThreadId();
35 pt.
hThread = GetCurrentThread();
36 pt.
uThId = GetCurrentThreadId();
56 static int pthread_mutex_check_for_static_initialization(
pthread_mutex_t *mutex ) {
59 if ( plasmawinthread_initialized == 0 ) {
61 plasmawinthread_initialized = 1;
74 rv = WaitForSingleObject( *mutex, INFINITE );
93 rv = WaitForSingleObject( *mutex, 0 );
109 if (! ReleaseMutex( *mutex ))
116 CloseHandle( *mutex );
140 void *(*PLASMA_realThStart)(
void *);
170 ResumeThread( thread->
hThread );
176 WaitForSingleObject( thread.
hThread, INFINITE );
182 InitializeCriticalSection( &cond->
cs );
183 cond->
hSem = CreateSemaphore( NULL,
187 cond->
hEvt = CreateEvent( NULL,
196 DeleteCriticalSection( &cond->
cs );
197 CloseHandle( cond->
hSem );
198 CloseHandle( cond->
hEvt );
208 EnterCriticalSection(&cond->
cs);
210 LeaveCriticalSection(&cond->
cs);
214 SignalObjectAndWait(*mutex, cond->
hSem, INFINITE,
FALSE);
217 EnterCriticalSection(&cond->
cs);
223 LeaveCriticalSection(&cond->
cs);
230 SignalObjectAndWait(cond->
hEvt, *mutex, INFINITE,
FALSE);
232 WaitForSingleObject(*mutex, INFINITE);
238 int more_waiters = 0;
241 EnterCriticalSection (&cond->
cs);
252 LeaveCriticalSection(&cond->
cs);
255 WaitForSingleObject(cond->
hEvt, INFINITE);
257 LeaveCriticalSection(&cond->
cs);
265 pthread_conclevel = level;