Searched refs:sema (Results 1 – 1 of 1) sorted by relevance
154 util_semaphore_init(util_semaphore *sema, int init_val) in util_semaphore_init() argument156 (void) mtx_init(&sema->mutex, mtx_plain); in util_semaphore_init()157 cnd_init(&sema->cond); in util_semaphore_init()158 sema->counter = init_val; in util_semaphore_init()162 util_semaphore_destroy(util_semaphore *sema) in util_semaphore_destroy() argument164 mtx_destroy(&sema->mutex); in util_semaphore_destroy()165 cnd_destroy(&sema->cond); in util_semaphore_destroy()170 util_semaphore_signal(util_semaphore *sema) in util_semaphore_signal() argument172 mtx_lock(&sema->mutex); in util_semaphore_signal()173 sema->counter++; in util_semaphore_signal()[all …]