Lines Matching refs:lock
39 * This is similar to the CACAS lock but makes use of an atomic decrement
40 * operation to check if the lock value was decremented to 0 from 1. The
51 ck_spinlock_dec_init(struct ck_spinlock_dec *lock)
54 lock->value = 1;
60 ck_spinlock_dec_trylock(struct ck_spinlock_dec *lock)
64 value = ck_pr_fas_uint(&lock->value, 0);
70 ck_spinlock_dec_locked(struct ck_spinlock_dec *lock)
74 r = ck_pr_load_uint(&lock->value) != 1;
80 ck_spinlock_dec_lock(struct ck_spinlock_dec *lock)
86 * Only one thread is guaranteed to decrement lock to 0.
88 * UINT_MAX lock requests can happen while the lock is held.
90 ck_pr_dec_uint_zero(&lock->value, &r);
95 while (ck_pr_load_uint(&lock->value) != 1)
104 ck_spinlock_dec_lock_eb(struct ck_spinlock_dec *lock)
110 ck_pr_dec_uint_zero(&lock->value, &r);
114 while (ck_pr_load_uint(&lock->value) != 1)
123 ck_spinlock_dec_unlock(struct ck_spinlock_dec *lock)
129 * Unconditionally set lock value to 1 so someone can decrement lock
132 ck_pr_store_uint(&lock->value, 1);