'\" t .\" Title: struct futex_q .\" Author: .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Futex API reference .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "STRUCT FUTEX_Q" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Futex API reference" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_futex_q \- The hashed futex queue entry, one per waiting task .SH "SYNOPSIS" .sp .nf struct futex_q { struct plist_node list; struct task_struct * task; spinlock_t * lock_ptr; union futex_key key; struct futex_pi_state * pi_state; struct rt_mutex_waiter * rt_waiter; union futex_key * requeue_pi_key; u32 bitset; }; .fi .SH "MEMBERS" .PP list .RS 4 priority\-sorted list of tasks waiting on this futex .RE .PP task .RS 4 the task waiting on the futex .RE .PP lock_ptr .RS 4 the hash bucket lock .RE .PP key .RS 4 the key the futex is hashed on .RE .PP pi_state .RS 4 optional priority inheritance state .RE .PP rt_waiter .RS 4 rt_waiter storage for use with requeue_pi .RE .PP requeue_pi_key .RS 4 the requeue_pi target futex key .RE .PP bitset .RS 4 bitset for the optional bitmasked wakeup .RE .SH "DESCRIPTION" .PP We use this hashed waitqueue, instead of a normal wait_queue_t, so we can wake only the relevant ones (hashed queues may be shared)\&. .PP A futex_q has a woken state, just like tasks have TASK_RUNNING\&. It is considered woken when plist_node_empty(q\->list) || q\->lock_ptr == 0\&. The order of wakeup is always to make the first condition true, then the second\&. .PP PI futexes are typically woken before they are removed from the hash list via the rt_mutex code\&. See \fBunqueue_me_pi\fR\&. .SH "AUTHOR" .PP \fBRusty Russell\fR <\&rusty@rustcorp.com.au\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br