lkml.org 
[lkml]   [2004]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.9-rc1-mm4 sparc reiser4 build broken - undefined atomic_sub_and_test
Salut,

On Mon, Sep 13, 2004 at 06:03:28PM +0200, Roman Zippel wrote:
> +#define atomic_add_and_test(i,v) (atomic_add_return((i), (v)) == 0)
> +#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0)

This is no longer atomic, is it? I mean, there's no guarantee that the
atomic_add_return and the comparison are executed without
interruption, is there?

I wonder whether it's supposed to be..

> #define atomic_sub(i, v) atomic_sub_return(i, v)

Maybe for some compilers we should cast away the result?

Tonnerre
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.083 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site