Lines Matching defs:lock
7 * An MCS like lock especially tailored for optimistic spinning for sleeping
8 * lock implementations (mutex, rwsem, etc).
17 int locked; /* 1 if lock acquired */
46 * Can return NULL in case we were the last queued and we updated @lock instead.
54 osq_wait_next(struct optimistic_spin_queue *lock,
61 if (atomic_read(&lock->tail) == curr &&
62 atomic_cmpxchg_acquire(&lock->tail, curr, old_cpu) == curr) {
64 * We were the last queued, we moved @lock back. @prev
65 * will now observe @lock and will complete its
78 * wait for either @lock to point to us, through its Step-B, or
93 bool osq_lock(struct optimistic_spin_queue *lock)
108 * the lock tail.
110 old = atomic_xchg(&lock->tail, curr);
141 * Wait to acquire the lock or cancellation. Note that need_resched()
155 * unlock()/unqueue() wait for a next pointer since @lock points to us
188 * Similar to unlock(), wait for @node->next or move @lock from @node
192 next = osq_wait_next(lock, node, prev->cpu);
210 void osq_unlock(struct optimistic_spin_queue *lock)
218 if (likely(atomic_cmpxchg_release(&lock->tail, curr,
232 next = osq_wait_next(lock, node, OSQ_UNLOCKED_VAL);