Lines Matching refs:cur_state

428       int32_t cur_state = state_and_contenders_.load(std::memory_order_relaxed);  in ExclusiveLock()  local
429 if (LIKELY((cur_state & kHeldMask) == 0) /* lock not held */) { in ExclusiveLock()
430 done = state_and_contenders_.CompareAndSetWeakAcquire(cur_state, cur_state | kHeldMask); in ExclusiveLock()
442 cur_state += kContenderIncrement; in ExclusiveLock()
447 if (futex(state_and_contenders_.Address(), FUTEX_WAIT_PRIVATE, cur_state, in ExclusiveLock()
460 cur_state = state_and_contenders_.load(std::memory_order_relaxed); in ExclusiveLock()
461 } while ((cur_state & kHeldMask) != 0); in ExclusiveLock()
493 int32_t cur_state = state_and_contenders_.load(std::memory_order_relaxed); in ExclusiveTryLock() local
494 if ((cur_state & kHeldMask) == 0) { in ExclusiveTryLock()
496 done = state_and_contenders_.CompareAndSetWeakAcquire(cur_state, cur_state | kHeldMask); in ExclusiveTryLock()
592 int32_t cur_state = state_and_contenders_.load(std::memory_order_relaxed); in ExclusiveUnlock() local
593 if (LIKELY((cur_state & kHeldMask) != 0)) { in ExclusiveUnlock()
597 uint32_t new_state = cur_state & ~kHeldMask; // Same number of contenders. in ExclusiveUnlock()
598 done = state_and_contenders_.CompareAndSetWeakRelease(cur_state, new_state); in ExclusiveUnlock()
612 LOG(FATAL) << "Unexpected state_ in unlock " << cur_state << " for " << name_; in ExclusiveUnlock()
618 cur_state, name_).c_str()); in ExclusiveUnlock()
690 int32_t cur_state = state_.load(std::memory_order_relaxed); in ExclusiveLock() local
691 if (LIKELY(cur_state == 0)) { in ExclusiveLock()
702 if (futex(state_.Address(), FUTEX_WAIT_PRIVATE, cur_state, nullptr, nullptr, 0) != 0) { in ExclusiveLock()
732 int32_t cur_state = state_.load(std::memory_order_relaxed); in ExclusiveUnlock() local
733 if (LIKELY(cur_state == -1)) { in ExclusiveUnlock()
746 LOG(FATAL) << "Unexpected state_:" << cur_state << " for " << name_; in ExclusiveUnlock()
763 int32_t cur_state = state_.load(std::memory_order_relaxed); in ExclusiveLockWithTimeout() local
764 if (cur_state == 0) { in ExclusiveLockWithTimeout()
781 if (futex(state_.Address(), FUTEX_WAIT_PRIVATE, cur_state, &rel_ts, nullptr, 0) != 0) { in ExclusiveLockWithTimeout()
817 void ReaderWriterMutex::HandleSharedLockContention(Thread* self, int32_t cur_state) { in HandleSharedLockContention() argument
825 if (futex(state_.Address(), FUTEX_WAIT_PRIVATE, cur_state, nullptr, nullptr, 0) != 0) { in HandleSharedLockContention()
841 int32_t cur_state = state_.load(std::memory_order_relaxed); in SharedTryLock() local
842 if (cur_state >= 0) { in SharedTryLock()
844 done = state_.CompareAndSetWeakAcquire(cur_state, cur_state + 1); in SharedTryLock()