futex_unqueue(9)
π futex_unqueue(9) β Kernel API Manual energy π
β¨ NAME β¨
futex_unqueue β remove the futex_q from its futex_hash_bucket. Thatβs the whole assignment, bestie π
πΈ SYNOPSIS πΈ
int futex_unqueue (struct futex_q *q );
π¦ ARGUMENTS π¦
qβ thefutex_qto unqueue. Thatβs it. Thatβs the argument. Slay π
π DESCRIPTION π
Okay so hereβs the part where you gotta pay attention, bestie: q->lock_ptr must not be held by the caller. No cap, thatβs important. π₯
A call to futex_unqueue must be paired with exactly one earlier call to futex_queue. Like, one-to-one, matching-set, no extra copies, periodt. β¨
π¨ Not me being dramatic, but fr fr: donβt holdq->lock_ptrwhen you call this, and donβt forget the matching earlierfutex_queuecall. That pairing rule is the vibe check.
π RETURN π
1β if thefutex_qwas still queued (and we removed unqueued it); π0β if thefutex_qwas already removed by the waking thread. π¦
π SEE ALSO π
Kernel file ./kernel/futex/core.c: __futex_hash(9), futex_setup_timer(9), get_futex_key(9), fault_in_user_writeable(9), futex_top_waiter(9), wait_for_owner_exiting(9), __futex_unqueue(9), futex_exit_recursive(9).
xoxo bestie β source/version: ./kernel/futex; date: October 2026 ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms