Lines Matching refs:oldval
39 extern int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
42 static __inline__ int compare_and_swap(long * ptr, long oldval, long newval, in compare_and_swap() argument
46 return __compare_and_swap(ptr, oldval, newval); in compare_and_swap()
48 return __pthread_compare_and_swap(ptr, oldval, newval, spinlock); in compare_and_swap()
60 compare_and_swap_with_release_semantics (long * ptr, long oldval,
63 return __compare_and_swap_with_release_semantics (ptr, oldval,
69 static __inline__ int compare_and_swap(long * ptr, long oldval, long newval,
72 return __compare_and_swap(ptr, oldval, newval);
77 extern int __pthread_compare_and_swap(long * ptr, long oldval, long newval,
80 static __inline__ int compare_and_swap(long * ptr, long oldval, long newval,
83 return __pthread_compare_and_swap(ptr, oldval, newval, spinlock);
178 long oldval; in pthread_atomic_increment() local
181 oldval = pa->p_count; in pthread_atomic_increment()
182 } while (!compare_and_swap(&pa->p_count, oldval, oldval + 1, &pa->p_spinlock)); in pthread_atomic_increment()
184 return oldval; in pthread_atomic_increment()
191 long oldval; in pthread_atomic_decrement() local
194 oldval = pa->p_count; in pthread_atomic_decrement()
195 } while (!compare_and_swap(&pa->p_count, oldval, oldval - 1, &pa->p_spinlock)); in pthread_atomic_decrement()
197 return oldval; in pthread_atomic_decrement()