This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: Joseph S.Myers <joseph at codesourcery dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, <libc-ports at sourceware dot org>, libc-alpha Devel <libc-alpha at sourceware dot org>
- Date: Wed, 11 Jul 2012 01:14:41 -0700 (PDT)
- Subject: Re: [PATCH] Unify pthread_spin_[try]lock implementations.
- References: <2109EAD5-BBE8-4C8C-8D61-0AF33290F240@codesourcery.com> <Pine.LNX.4.64.1206282306320.20312@digraph.polyomino.org.uk> <65B470D2-4D01-4BA1-AEC5-A72C0006EA22@codesourcery.com>
> +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?