Lines Matching refs:semaphore
62 HANDLE semaphore; member
184 HANDLE semaphore = ::TlsGetValue(thread_wait_sema_TLS_index); in GetThreadSemaphore() local
185 if (semaphore == NULL) in GetThreadSemaphore()
187 semaphore = ::CreateSemaphore(NULL, 0, 1, NULL); in GetThreadSemaphore()
188 ::TlsSetValue(thread_wait_sema_TLS_index, semaphore); in GetThreadSemaphore()
191 return semaphore; in GetThreadSemaphore()
198 HANDLE semaphore = (HANDLE)::TlsGetValue(thread_wait_sema_TLS_index); in FreeThreadSemaphore() local
200 if (semaphore != NULL) in FreeThreadSemaphore()
203 ::CloseHandle(semaphore); in FreeThreadSemaphore()
577 HANDLE semaphore = GetThreadSemaphore(); in cond_wait_internal() local
582 this_wait.semaphore = semaphore; in cond_wait_internal()
603 DWORD result = ::WaitForSingleObject(semaphore, timeout_milliseconds); in cond_wait_internal()
638 ::WaitForSingleObject(semaphore, INFINITE); in cond_wait_internal()
708 ::ReleaseSemaphore(first->semaphore, 1, NULL); in dng_pthread_cond_signal()
735 ::ReleaseSemaphore(first->semaphore, 1, NULL); in dng_pthread_cond_broadcast()
752 if (::InterlockedIncrement(&once->semaphore) == 0) in dng_pthread_once()
811 HANDLE semaphore; member
848 HANDLE semaphore = head_waiter->semaphore; in WakeHeadWaiter() local
854 ::ReleaseSemaphore(semaphore, 1, NULL); in WakeHeadWaiter()
909 HANDLE semaphore=NULL; in dng_pthread_rwlock_rdlock() local
919 semaphore = GetThreadSemaphore(); in dng_pthread_rwlock_rdlock()
922 this_wait.semaphore = semaphore; in dng_pthread_rwlock_rdlock()
942 result = (WaitForSingleObject(semaphore, INFINITE) == WAIT_OBJECT_0) ? 0 : -1; in dng_pthread_rwlock_rdlock()
1035 HANDLE semaphore=NULL; in dng_pthread_rwlock_wrlock() local
1047 semaphore = GetThreadSemaphore(); in dng_pthread_rwlock_wrlock()
1050 this_wait.semaphore = semaphore; in dng_pthread_rwlock_wrlock()
1072 result = (WaitForSingleObject(semaphore, INFINITE) == WAIT_OBJECT_0) ? 0 : -1; in dng_pthread_rwlock_wrlock()