Lines Matching +full:critical +full:- +full:action
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 * Reusable 2 PHASE task barrier (rendez-vous point) implementation for N tasks.
28 * Based on the Little book of semaphores - https://greenteapress.com/wp/semaphores/
57 tb->n = 0; in task_barrier_init()
58 atomic_set(&tb->count, 0); in task_barrier_init()
59 sema_init(&tb->enter_turnstile, 0); in task_barrier_init()
60 sema_init(&tb->exit_turnstile, 0); in task_barrier_init()
65 tb->n++; in task_barrier_add_task()
70 tb->n--; in task_barrier_rem_task()
74 * Lines up all the threads BEFORE the critical point.
80 if (atomic_inc_return(&tb->count) == tb->n) in task_barrier_enter()
81 task_barrier_signal_turnstile(&tb->enter_turnstile, tb->n); in task_barrier_enter()
83 down(&tb->enter_turnstile); in task_barrier_enter()
87 * Lines up all the threads AFTER the critical point.
94 if (atomic_dec_return(&tb->count) == 0) in task_barrier_exit()
95 task_barrier_signal_turnstile(&tb->exit_turnstile, tb->n); in task_barrier_exit()
97 down(&tb->exit_turnstile); in task_barrier_exit()