[PATCH] sysdeps/generic/dl-fptr.c, default CAS parameter order wrong.

Carlos O'Donell carlos@baldric.uwo.ca
Thu Dec 11 22:11:00 GMT 2003


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.



More information about the Libc-alpha mailing list