Lines Matching refs:fc

252 futex_condvar_assert(const struct futex_condvar *fc)
255 KASSERT(fc->fc_waitcount >= futex_queue_count(&fc->fc_waiters),
257 futex_lock_assert(fc->fc_lock);
265 struct futex_condvar *fc;
273 LIST_FOREACH(fc, &futex_condvar_list, fc_next) {
274 if (futex_address_match(&fc->fc_address, &fa_condvar)) {
277 futex_condvar_assert(fc);
278 *fcret = fc;
294 struct futex_condvar *fc;
308 LIST_FOREACH(fc, &futex_condvar_list, fc_next) {
309 if (!futex_address_match(&fc->fc_address, &fa_condvar))
311 fl = fc->fc_lock;
323 futex_condvar_assert(fc);
324 *fcret = fc;
329 fc = malloc(sizeof(*fc), M_FUTEX, M_WAITOK);
330 fc->fc_address = fa_condvar;
331 fc->fc_lock = futex_lock_lookup_locked(&fa_lock);
332 futex_queue_init(&fc->fc_waiters);
333 fc->fc_waitcount = 0;
334 LIST_INSERT_HEAD(&futex_condvar_list, fc, fc_next);
335 *fcret = fc;
340 futex_condvar_release(struct futex_condvar *fc)
344 futex_condvar_assert(fc);
345 fl = fc->fc_lock;
346 if (fc->fc_waitcount == 0) {
348 futex_address_free(&fc->fc_address);
349 LIST_REMOVE(fc, fc_next);
350 free(fc, M_FUTEX);
356 futex_condvar_unmanage(struct futex_condvar *fc,
360 if (futex_queue_count(&fc->fc_waiters) != 0)
983 struct futex_condvar *fc;
990 lock_scope, &fc);
993 fl = fc->fc_lock;
1002 futex_condvar_release(fc);
1009 futex_condvar_unmanage(fc, condvar);
1010 futex_condvar_release(fc);
1015 ++fc->fc_waitcount;
1016 error = futex_queue_sleep(&fc->fc_waiters, fc->fc_lock, &fw, td,
1024 futex_condvar_unmanage(fc, condvar);
1043 futex_condvar_unmanage(fc, condvar);
1046 --fc->fc_waitcount;
1047 futex_condvar_release(fc);
1099 struct futex_condvar *fc;
1111 error = futex_condvar_lookup(td, uap->condvar, uap->scope, &fc);
1116 fl = fc->fc_lock;
1136 futex_queue_wake_up_donate(&fc->fc_waiters, nwaiters - 1);
1143 futex_queue_requeue(&fc->fc_waiters, &fl->fl_writers, nwaiters);
1147 error = futex_condvar_unmanage(fc, uap->condvar);
1148 futex_condvar_release(fc);