Home
last modified time | relevance | path

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

/unit/src/
H A Dnxt_semaphore.c48 nxt_sem_destroy(nxt_sem_t *sem) in nxt_sem_destroy() argument
50 if (sem_destroy(sem) == 0) { in nxt_sem_destroy()
60 nxt_sem_post(nxt_sem_t *sem) in nxt_sem_post() argument
90 n = sem_wait(sem); in nxt_sem_wait()
177 sem->count = count; in nxt_sem_init()
189 nxt_sem_destroy(nxt_sem_t *sem) in nxt_sem_destroy() argument
197 nxt_sem_post(nxt_sem_t *sem) in nxt_sem_post() argument
207 sem->count++; in nxt_sem_post()
226 while (sem->count == 0) { in nxt_sem_wait()
228 err = nxt_thread_cond_wait(&sem->cond, &sem->mutex, timeout); in nxt_sem_wait()
[all …]
H A Dnxt_semaphore.h26 NXT_EXPORT nxt_int_t nxt_sem_init(nxt_sem_t *sem, nxt_uint_t count);
27 NXT_EXPORT void nxt_sem_destroy(nxt_sem_t *sem);
28 NXT_EXPORT nxt_int_t nxt_sem_post(nxt_sem_t *sem);
29 NXT_EXPORT nxt_err_t nxt_sem_wait(nxt_sem_t *sem, nxt_nsec_t timeout);
H A Dnxt_thread_pool.c52 (void) nxt_sem_post(&tp->sem); in nxt_thread_pool_post()
84 if (nxt_fast_path(nxt_sem_init(&tp->sem, 0) == NXT_OK)) { in nxt_thread_pool_init()
98 nxt_sem_destroy(&tp->sem); in nxt_thread_pool_init()
181 err = nxt_sem_wait(&tp->sem, tp->timeout); in nxt_thread_pool_wait()
297 nxt_sem_destroy(&tp->sem); in nxt_thread_pool_exit()
H A Dnxt_thread_pool.h20 nxt_sem_t sem; member
/unit/auto/
H A Dthreads134 sem_t sem;
137 if (sem_init(&sem, 0, 0) != 0)
139 if (sem_post(&sem) != 0)
144 if (sem_timedwait(&sem, &ts) != 0)
147 if (sem_destroy(&sem) != 0)