This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Unify pthread_spin_[try]lock implementations.


> +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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]