Searched refs:old_state (Results 1 – 9 of 9) sorted by relevance
/bionic/libc/bionic/ |
D | pthread_detach.cpp | 40 ThreadJoinState old_state = THREAD_NOT_JOINED; in pthread_detach() local 41 while (old_state == THREAD_NOT_JOINED && in pthread_detach() 42 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_DETACHED)) { in pthread_detach() 45 if (old_state == THREAD_NOT_JOINED) { in pthread_detach() 47 } else if (old_state == THREAD_EXITED_NOT_JOINED) { in pthread_detach()
|
D | pthread_join.cpp | 44 ThreadJoinState old_state = THREAD_NOT_JOINED; in pthread_join() local 45 while ((old_state == THREAD_NOT_JOINED || old_state == THREAD_EXITED_NOT_JOINED) && in pthread_join() 46 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_JOINED)) { in pthread_join() 49 if (old_state == THREAD_DETACHED || old_state == THREAD_JOINED) { in pthread_join()
|
D | pthread_mutex.cpp | 280 uint16_t old_state = unlocked; in __pthread_normal_mutex_trylock() local 281 if (__predict_true(atomic_compare_exchange_strong_explicit(&mutex->state, &old_state, in __pthread_normal_mutex_trylock() 380 uint16_t old_state) { in __recursive_increment() argument 384 if (MUTEX_COUNTER_BITS_WILL_OVERFLOW(old_state)) { in __recursive_increment() 398 uint16_t old_state, in __recursive_or_errorcheck_mutex_wait() argument 407 return __futex_wait_ex(&mutex->state, shared, old_state, use_realtime_clock, abs_timeout); in __recursive_or_errorcheck_mutex_wait() 416 return __futex_wait_ex(&mutex->state, shared, (owner_tid << 16) | old_state, in __recursive_or_errorcheck_mutex_wait() 424 uint16_t old_state = atomic_load_explicit(&mutex->state, memory_order_relaxed); in __pthread_mutex_lock_with_timeout() local 425 uint16_t mtype = (old_state & MUTEX_TYPE_MASK); in __pthread_mutex_lock_with_timeout() 426 uint16_t shared = (old_state & MUTEX_SHARED_MASK); in __pthread_mutex_lock_with_timeout() [all …]
|
D | pthread_rwlock.cpp | 263 static inline __always_inline bool __can_acquire_read_lock(int old_state, in __can_acquire_read_lock() argument 267 bool cannot_apply = __state_owned_by_writer(old_state) || in __can_acquire_read_lock() 268 (writer_nonrecursive_preferred && __state_have_pending_writers(old_state)); in __can_acquire_read_lock() 273 int old_state = atomic_load_explicit(&rwlock->state, memory_order_relaxed); in __pthread_rwlock_tryrdlock() local 275 …while (__predict_true(__can_acquire_read_lock(old_state, rwlock->writer_nonrecursive_preferred))) { in __pthread_rwlock_tryrdlock() 277 int new_state = old_state + STATE_READER_COUNT_CHANGE_STEP; in __pthread_rwlock_tryrdlock() 281 if (__predict_true(atomic_compare_exchange_weak_explicit(&rwlock->state, &old_state, new_state, in __pthread_rwlock_tryrdlock() 306 int old_state = atomic_load_explicit(&rwlock->state, memory_order_relaxed); in __pthread_rwlock_timedrdlock() local 307 if (__can_acquire_read_lock(old_state, rwlock->writer_nonrecursive_preferred)) { in __pthread_rwlock_timedrdlock() 318 old_state = atomic_fetch_or_explicit(&rwlock->state, STATE_HAVE_PENDING_READERS_FLAG, in __pthread_rwlock_timedrdlock() [all …]
|
D | pthread_exit.cpp | 99 ThreadJoinState old_state = THREAD_NOT_JOINED; in pthread_exit() local 100 while (old_state == THREAD_NOT_JOINED && in pthread_exit() 101 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_EXITED_NOT_JOINED)) { in pthread_exit() 104 if (old_state == THREAD_DETACHED) { in pthread_exit()
|
D | pthread_cond.cpp | 180 unsigned int old_state = atomic_load_explicit(&cond->state, memory_order_relaxed); in __pthread_cond_timedwait() local 182 int status = __futex_wait_ex(&cond->state, cond->process_shared(), old_state, in __pthread_cond_timedwait()
|
/bionic/libc/private/ |
D | bionic_lock.h | 54 LockState old_state = Unlocked; in trylock() local 55 return __predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state, in trylock() 60 LockState old_state = Unlocked; in lock() local 61 if (__predict_true(atomic_compare_exchange_strong_explicit(&state, &old_state, in lock()
|
/bionic/libc/stdio/ |
D | stdio_ext.cpp | 80 int old_state = _EXT(fp)->_caller_handles_locking ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL; in __fsetlocking() local 82 return old_state; in __fsetlocking() 91 return old_state; in __fsetlocking()
|
/bionic/tests/ |
D | stdio_ext_test.cpp | 153 int old_state = __fsetlocking(stdout, FSETLOCKING_BYCALLER); in TEST() local 163 __fsetlocking(stdout, old_state); in TEST()
|