This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] sysdeps/generic/dl-fptr.c, default CAS parameter order wrong.
- From: Carlos O'Donell <carlos at baldric dot uwo dot ca>
- To: libc-alpha <libc-alpha at sources dot redhat dot com>
- Date: Thu, 11 Dec 2003 17:04:54 -0500
- Subject: Re: [PATCH] sysdeps/generic/dl-fptr.c, default CAS parameter order wrong.
- References: <20031211214333.GJ2601@systemhalted>
On Thu, Dec 11, 2003 at 04:43:33PM -0500, Carlos O'Donell wrote:
>
> #ifndef COMPARE_AND_SWAP
> #define COMPARE_AND_SWAP(ptr,old,new) \
> - atomic_compare_and_exchange_bool_acq ((ptr), (old), (new))
> + atomic_compare_and_exchange_bool_acq ((ptr), (new), (old))
> #endif
>
Spoke too soon, sorry for the noise. The semantics are backwards too.
The above function returns zero when an exchange happens, otherwise
non-zero. Will need a ( x == 0 ) encasing.
c.