FreeBSD/sys/compat/cloudabi/cloudabi_futex.c
/* Moves up to nwaiters waiters from one queue to another. */
Moves up to nwaiters waiters from one queue to another.
Moves up to nwaiters waiters from one queue to another .
static void
futex_queue_requeue(struct futex_queue *fqfrom, struct futex_queue *fqto,
    unsigned int nwaiters)
{
	struct futex_waiter *fw;
	while (nwaiters-- > 0 && !STAILQ_EMPTY(&fqfrom->fq_list)) {
		fw = STAILQ_FIRST(&fqfrom->fq_list);
		STAILQ_REMOVE_HEAD(&fqfrom->fq_list, fw_next);
		--fqfrom->fq_count;
		fw->fw_queue = fqto;
		STAILQ_INSERT_TAIL(&fqto->fq_list, fw, fw_next);
		++fqto->fq_count;
	}
}
static void futex_queue_requeue ( struct futex_queue * fqfrom , struct futex_queue * fqto , unsigned int nwaiters ) { struct futex_waiter * fw ; while ( nwaiters -- > 0 && ! STAILQ_EMPTY ( & fqfrom -> fq_list ) ) { fw = STAILQ_FIRST ( & fqfrom -> fq_list ) ; STAILQ_REMOVE_HEAD ( & fqfrom -> fq_list , fw_next ) ; -- fqfrom -> fq_count ; fw -> fw_queue = fqto ; STAILQ_INSERT_TAIL ( & fqto -> fq_list , fw , fw_next ) ; ++ fqto -> fq_count ; } }
Moves up to nwaiters waiters from one queue to another.
Moves up to nwaiters waiters from one queue to another .
/* Move waiters to the target queue. */