Lines Matching refs:sem
436 int uv_sem_init(uv_sem_t* sem, unsigned int value) { in uv_sem_init() argument
437 *sem = CreateSemaphore(NULL, value, INT_MAX, NULL); in uv_sem_init()
438 if (*sem == NULL) in uv_sem_init()
445 void uv_sem_destroy(uv_sem_t* sem) { in uv_sem_destroy() argument
446 if (!CloseHandle(*sem)) in uv_sem_destroy()
451 void uv_sem_post(uv_sem_t* sem) { in uv_sem_post() argument
452 if (!ReleaseSemaphore(*sem, 1, NULL)) in uv_sem_post()
457 void uv_sem_wait(uv_sem_t* sem) { in uv_sem_wait() argument
458 if (WaitForSingleObject(*sem, INFINITE) != WAIT_OBJECT_0) in uv_sem_wait()
463 int uv_sem_trywait(uv_sem_t* sem) { in uv_sem_trywait() argument
464 DWORD r = WaitForSingleObject(*sem, 0); in uv_sem_trywait()