> >Don't think so. Well, it is safe on i386, but on other architectures,
> >test_and_set_bit is not guaranteed to be atomic. [And I'm afraid that
>
> Arggh I thought that test_and_set_bit() was atomic on all ports (since I
> looked only its i386 implementation)!
Mistake.
> At first I can see test_and_set_bit() very more helpful if
> implemented atomic.
I was told that atomic test_and_set_bit would be too expensive on sparc.
> As second since it' s declared _not_ atomic in Linux, why i386 implement
> it atomic?
Because in i386 port it _IS_ atomic, so in arch/i386 you can assume
that test_and_set_bit is atomic. Strange, is not it? Should be
documented somewhere.
Pavel
-- I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu