This is the mail archive of the libc-alpha@sources.redhat.com 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] sysdeps/generic/dl-fptr.c, default CAS parameter order wrong.


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.


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