Home
last modified time | relevance | path

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

/libuv/src/unix/
H A Dthread.c564 sem = uv__malloc(sizeof(*sem)); in uv__custom_sem_init()
565 if (sem == NULL) in uv__custom_sem_init()
569 uv__free(sem); in uv__custom_sem_init()
575 uv__free(sem); in uv__custom_sem_init()
579 sem->value = value; in uv__custom_sem_init()
591 uv__free(sem); in uv__custom_sem_destroy()
600 sem->value++; in uv__custom_sem_post()
613 uv_cond_wait(&sem->cond, &sem->mutex); in uv__custom_sem_wait()
614 sem->value--; in uv__custom_sem_wait()
631 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-name.c36 struct semaphores* sem; in thread_run() local
39 sem = arg; in thread_run()
51 uv_sem_post(&sem->worker); in thread_run()
58 uv_sem_wait(&sem->main); in thread_run()
67 struct semaphores sem; in TEST_IMPL() local
76 ASSERT_OK(uv_sem_init(&sem.main, 0)); in TEST_IMPL()
77 ASSERT_OK(uv_sem_init(&sem.worker, 0)); in TEST_IMPL()
126 uv_sem_wait(&sem.worker); in TEST_IMPL()
133 uv_sem_post(&sem.main); in TEST_IMPL()
137 uv_sem_destroy(&sem.main); 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.c436 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
[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.rst230 .. c:function:: int uv_sem_init(uv_sem_t* sem, unsigned int value)
231 .. c:function:: void uv_sem_destroy(uv_sem_t* sem)
232 .. c:function:: void uv_sem_post(uv_sem_t* sem)
233 .. c:function:: void uv_sem_wait(uv_sem_t* sem)
234 .. c:function:: int uv_sem_trywait(uv_sem_t* sem)
/libuv/include/
H A Duv.h1847 UV_EXTERN int uv_sem_init(uv_sem_t* sem, unsigned int value);
1848 UV_EXTERN void uv_sem_destroy(uv_sem_t* sem);
1849 UV_EXTERN void uv_sem_post(uv_sem_t* sem);
1850 UV_EXTERN void uv_sem_wait(uv_sem_t* sem);
1851 UV_EXTERN int uv_sem_trywait(uv_sem_t* sem);

Completed in 25 milliseconds