Lines Matching refs:lock

54   pointer to a single linked list of 'lock entries', one per lock,
56 to itself, 'head'. The last 'lock entry' points back to the 'head'.
59 address of the associated 'lock entry', plus or minus, of what will
60 be called the 'lock word', from that 'lock entry'. The 'lock word'
61 is always a 32 bit word, unlike the other words above. The 'lock
63 of the thread holding the lock in the bottom 29 bits. See further
67 the address of the 'lock entry', during list insertion and removal,
71 Each 'lock entry' on the single linked list starting at 'head' consists
72 of just a single word, pointing to the next 'lock entry', or back to
73 'head' if there are no more entries. In addition, nearby to each 'lock
74 entry', at an offset from the 'lock entry' specified by the 'offset'
75 word, is one 'lock word'.
77 The 'lock word' is always 32 bits, and is intended to be the same 32 bit
78 lock variable used by the futex mechanism, in conjunction with
80 waiting for a lock on a threads exit if that next thread used the futex
81 mechanism to register the address of that 'lock word' with the kernel.
83 For each futex lock currently held by a thread, if it wants this
84 robust_futex support for exit cleanup of that lock, it should have one
85 'lock entry' on this list, with its associated 'lock word' at the
89 that lock using the futex mechanism.
101 larger, user level locking structures, one per lock. The kernel
103 long as the 'offset' to the 'lock word' is the same for all
105 it currently holds using the 'lock entry' pointers. It may also have
121 There may exist thousands of futex lock structures in a threads shared
123 lock structures for locks currently held by that thread should be on
124 that thread's robust_futex linked lock list a given time.
126 A given futex lock structure in a user shared memory region may be held
128 thread currently holding such a lock, if any, is marked with the threads
129 TID in the lower 29 bits of the 'lock word'.
131 When adding or removing a lock from its list of held locks, in order for
132 the kernel to correctly handle lock cleanup regardless of when the task
135 protocol on 'lock entry' insertion and removal:
138 1) set the 'list_op_pending' word to the address of the 'lock entry'
140 2) acquire the futex lock,
141 3) add the lock entry, with its thread id (TID) in the bottom 29 bits
142 of the 'lock word', to the linked list starting at 'head', and
146 1) set the 'list_op_pending' word to the address of the 'lock entry'
148 2) remove the lock entry for this lock from the 'head' list,
149 3) release the futex lock, and
153 'list_op_pending' and the address of each 'lock word' found by walking
155 bits of the 'lock word' at offset 'offset' from that address equals the
161 2) atomically set bit 30 (0x40000000) in the 'lock word'.
163 In the above, bit 31 was set by futex waiters on that lock to indicate
165 lock owner died holding the lock.
172 2) the calculated location of the 'lock word' (address plus
178 When the kernel sees a list entry whose 'lock word' doesn't have the
182 Bit 29 (0x20000000) of the 'lock word' is reserved for future use.