On Tue, Oct 02, 2007 at 03:22:10PM +0100, Thiemo Seufer wrote: > > +#define __cmpxchg(ptr,old,new,barrier) \ > > +({ \ > > + __typeof__(ptr) __ptr = (ptr); \ > > + __typeof__(*(ptr)) __old = (old); \ > > + __typeof__(*(ptr)) __new = (new); \ > > + __typeof__(*(ptr)) __res = 0; \ > > Maybe we need an acquire barrier here for some systems. Release you meant. The acquire lock would be at the end. Documentation and actual implmeentations of cmpxchg seem to differ. It's a relativly rarely used primitve so I think I err on the side of paranoia for now and throw in the additional SYNC you suggest. Ralf