Home
last modified time | relevance | path

Searched refs:sem (Results 1 – 8 of 8) sorted by relevance

/libuv/src/unix/
H A Dthread.c543 sem = uv__malloc(sizeof(*sem)); in uv__custom_sem_init()
544 if (sem == NULL) in uv__custom_sem_init()
548 uv__free(sem); in uv__custom_sem_init()
554 uv__free(sem); in uv__custom_sem_init()
558 sem->value = value; in uv__custom_sem_init()
570 uv__free(sem); in uv__custom_sem_destroy()
579 sem->value++; in uv__custom_sem_post()
592 uv_cond_wait(&sem->cond, &sem->mutex); in uv__custom_sem_wait()
593 sem->value--; in uv__custom_sem_wait()
610 sem->value--; in uv__custom_sem_trywait()
[all …]
/libuv/test/
H A Dtest-semaphore.c30 uv_sem_t sem; member
44 uv_sem_post(&c->sem); in worker()
68 uv_sem_destroy(&wc.sem); in TEST_IMPL()
85 uv_sem_wait(&wc.sem); in TEST_IMPL()
89 uv_sem_destroy(&wc.sem); in TEST_IMPL()
96 uv_sem_t sem; in TEST_IMPL() local
98 ASSERT_OK(uv_sem_init(&sem, 3)); in TEST_IMPL()
101 ASSERT_OK(uv_sem_trywait(&sem)); in TEST_IMPL()
104 uv_sem_post(&sem); in TEST_IMPL()
105 ASSERT_OK(uv_sem_trywait(&sem)); in TEST_IMPL()
[all …]
H A Dtest-thread-priority.c40 uv_sem_t sem; variable
43 uv_sem_wait(&sem); in simple_task()
59 ASSERT_OK(uv_sem_init(&sem, 1)); in TEST_IMPL()
60 uv_sem_wait(&sem); in TEST_IMPL()
98 uv_sem_post(&sem); in TEST_IMPL()
102 uv_sem_destroy(&sem); in TEST_IMPL()
H A Dtest-signal-multiple-loops.c52 static uv_sem_t sem; variable
114 uv_sem_post(&sem); in signal_handling_worker()
136 uv_sem_post(&sem); in signal_handling_worker()
231 r = uv_sem_init(&sem, 0); in TEST_IMPL()
261 uv_sem_wait(&sem); in TEST_IMPL()
270 uv_sem_wait(&sem); in TEST_IMPL()
301 uv_sem_destroy(&sem); in TEST_IMPL()
/libuv/src/win/
H A Dthread.c362 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
[all …]
/libuv/src/
H A Dthreadpool.c197 uv_sem_t sem; in init_threads() local
227 if (uv_sem_init(&sem, 0)) in init_threads()
234 if (uv_thread_create_ex(threads + i, &config, worker, &sem)) in init_threads()
238 uv_sem_wait(&sem); in init_threads()
240 uv_sem_destroy(&sem); in init_threads()
/libuv/docs/src/
H A Dthreading.rst205 .. c:function:: int uv_sem_init(uv_sem_t* sem, unsigned int value)
206 .. c:function:: void uv_sem_destroy(uv_sem_t* sem)
207 .. c:function:: void uv_sem_post(uv_sem_t* sem)
208 .. c:function:: void uv_sem_wait(uv_sem_t* sem)
209 .. c:function:: int uv_sem_trywait(uv_sem_t* sem)
/libuv/include/
H A Duv.h1841 UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
1842 UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
1843 UV_EXTERN void uv_sem_post(uv_sem_t* sem);
1844 UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
1845 UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);

Completed in 29 milliseconds