Lines Matching defs:old
341 template <Role role> LIBC_INLINE LockResult try_lock(RwState &old) {
343 while (LIBC_LIKELY(old.can_acquire<Role::Reader>(get_preference()))) {
344 cpp::optional<RwState> next = old.try_increase_reader_count();
347 if (LIBC_LIKELY(old.compare_exchange_weak_with(
351 // Notice that old is updated by the compare_exchange_weak_with
357 while (LIBC_LIKELY(old.can_acquire<Role::Writer>(get_preference()))) {
358 if (LIBC_LIKELY(old.compare_exchange_weak_with(
359 state, old.set_writer_bit(), cpp::MemoryOrder::ACQUIRE,
364 // Notice that old is updated by the compare_exchange_weak_with
380 RwState old = RwState::load(state, cpp::MemoryOrder::RELAXED);
381 return try_lock<Role::Reader>(old);
385 RwState old = RwState::load(state, cpp::MemoryOrder::RELAXED);
386 return try_lock<Role::Writer>(old);
407 RwState old =
413 LockResult result = try_lock<role>(old);
432 old = RwState::fetch_set_pending_bit<role>(state,
441 if (!old.can_acquire<role>(get_preference()))
464 old = RwState::spin_reload<role>(state, get_preference(), spin_count);
518 RwState old = RwState::load(state, cpp::MemoryOrder::RELAXED);
519 if (old.has_active_writer()) {
527 old =
530 if (!old.has_pending())
532 } else if (old.has_active_reader()) {
535 old = RwState::fetch_sub_reader_count(state, cpp::MemoryOrder::RELEASE);
537 if (!old.has_last_reader() || !old.has_pending())
550 RwState old = RwState::load(state, cpp::MemoryOrder::RELAXED);
551 if (old.has_active_owner())