[PATCH] Unify pthread_spin_[try]lock implementations.

Roland McGrath roland@hack.frob.com
Wed Jul 11 08:15:00 GMT 2012


> +int
> +pthread_spin_lock (pthread_spinlock_t *lock)
> +{
> +  while (atomic_compare_and_exchange_val_acq (lock, 1, 0) != 0)
> +    while (*lock != 0)
> +      ;

What's the inner loop for?



More information about the Libc-alpha mailing list