Lines Matching refs:eMutex

211 static void async_mutex_enter(int eMutex);
212 static void async_mutex_leave(int eMutex);
213 static void async_cond_wait(int eCond, int eMutex);
287 static void async_mutex_enter(int eMutex){ in async_mutex_enter() argument
288 assert( eMutex==0 || eMutex==1 || eMutex==2 ); in async_mutex_enter()
289 assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); in async_mutex_enter()
290 assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); in async_mutex_enter()
291 assert( eMutex!=0 || (!mutex_held(0)) ); in async_mutex_enter()
292 EnterCriticalSection(&primitives.aMutex[eMutex]); in async_mutex_enter()
293 TESTONLY( primitives.aHolder[eMutex] = GetCurrentThreadId(); ) in async_mutex_enter()
295 static void async_mutex_leave(int eMutex){ in async_mutex_leave() argument
296 assert( eMutex==0 || eMutex==1 || eMutex==2 ); in async_mutex_leave()
297 assert( mutex_held(eMutex) ); in async_mutex_leave()
298 TESTONLY( primitives.aHolder[eMutex] = 0; ) in async_mutex_leave()
299 LeaveCriticalSection(&primitives.aMutex[eMutex]); in async_mutex_leave()
301 static void async_cond_wait(int eCond, int eMutex){ in async_cond_wait() argument
303 async_mutex_leave(eMutex); in async_cond_wait()
305 async_mutex_enter(eMutex); in async_cond_wait()
338 static void async_mutex_enter(int eMutex){ in async_mutex_enter() argument
339 assert( eMutex==0 || eMutex==1 || eMutex==2 ); in async_mutex_enter()
340 assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); in async_mutex_enter()
341 assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); in async_mutex_enter()
342 assert( eMutex!=0 || (!mutex_held(0)) ); in async_mutex_enter()
343 pthread_mutex_lock(&primitives.aMutex[eMutex]); in async_mutex_enter()
344 TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) in async_mutex_enter()
346 static void async_mutex_leave(int eMutex){ in async_mutex_leave() argument
347 assert( eMutex==0 || eMutex==1 || eMutex==2 ); in async_mutex_leave()
348 assert( mutex_held(eMutex) ); in async_mutex_leave()
349 TESTONLY( primitives.aHolder[eMutex] = 0; ) in async_mutex_leave()
350 pthread_mutex_unlock(&primitives.aMutex[eMutex]); in async_mutex_leave()
352 static void async_cond_wait(int eCond, int eMutex){ in async_cond_wait() argument
353 assert( eMutex==0 || eMutex==1 || eMutex==2 ); in async_cond_wait()
354 assert( mutex_held(eMutex) ); in async_cond_wait()
355 TESTONLY( primitives.aHolder[eMutex] = 0; ) in async_cond_wait()
356 pthread_cond_wait(&primitives.aCond[eCond], &primitives.aMutex[eMutex]); in async_cond_wait()
357 TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) in async_cond_wait()