Lines Matching refs:sem
362 int uv_sem_init(uv_sem_t* sem, unsigned int value) { in uv_sem_init() argument
363 *sem = CreateSemaphore(NULL, value, INT_MAX, NULL); in uv_sem_init()
364 if (*sem == NULL) in uv_sem_init()
371 void uv_sem_destroy(uv_sem_t* sem) { in uv_sem_destroy() argument
372 if (!CloseHandle(*sem)) in uv_sem_destroy()
377 void uv_sem_post(uv_sem_t* sem) { in uv_sem_post() argument
378 if (!ReleaseSemaphore(*sem, 1, NULL)) in uv_sem_post()
383 void uv_sem_wait(uv_sem_t* sem) { in uv_sem_wait() argument
384 if (WaitForSingleObject(*sem, INFINITE) != WAIT_OBJECT_0) in uv_sem_wait()
389 int uv_sem_trywait(uv_sem_t* sem) { in uv_sem_trywait() argument
390 DWORD r = WaitForSingleObject(*sem, 0); in uv_sem_trywait()