Lines Matching +full:wait +full:- +full:queue

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
18 * queued_read_lock_slowpath - acquire read lock of a queued rwlock
31 * without waiting in the queue. in queued_read_lock_slowpath()
33 atomic_cond_read_acquire(&lock->cnts, !(VAL & _QW_LOCKED)); in queued_read_lock_slowpath()
36 atomic_sub(_QR_BIAS, &lock->cnts); in queued_read_lock_slowpath()
41 * Put the reader into the wait queue in queued_read_lock_slowpath()
43 arch_spin_lock(&lock->wait_lock); in queued_read_lock_slowpath()
44 atomic_add(_QR_BIAS, &lock->cnts); in queued_read_lock_slowpath()
51 atomic_cond_read_acquire(&lock->cnts, !(VAL & _QW_LOCKED)); in queued_read_lock_slowpath()
54 * Signal the next one in queue to become queue head in queued_read_lock_slowpath()
56 arch_spin_unlock(&lock->wait_lock); in queued_read_lock_slowpath()
63 * queued_write_lock_slowpath - acquire write lock of a queued rwlock
72 /* Put the writer into the wait queue */ in queued_write_lock_slowpath()
73 arch_spin_lock(&lock->wait_lock); in queued_write_lock_slowpath()
76 if (!(cnts = atomic_read(&lock->cnts)) && in queued_write_lock_slowpath()
77 atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED)) in queued_write_lock_slowpath()
81 atomic_or(_QW_WAITING, &lock->cnts); in queued_write_lock_slowpath()
85 cnts = atomic_cond_read_relaxed(&lock->cnts, VAL == _QW_WAITING); in queued_write_lock_slowpath()
86 } while (!atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED)); in queued_write_lock_slowpath()
88 arch_spin_unlock(&lock->wait_lock); in queued_write_lock_slowpath()