Ulrich Weigand <[EMAIL PROTECTED]> writes:
> But in this case, I think Ove is basically right: you have only one
> race between QUEUE_SetWakeBit and QUEUE_WaitBits.
Well, yes of course, the race is between testing and setting the bits,
but the race not only happens if the compiler optimizes out the second
test, it can happen for a number of reasons (like reordering of the
assignments, two threads setting bits at the same time, etc.)
My point was that this second test buys nothing at all, no matter if
it's optimized out or not, since it cannot possibly avoid the race. A
critical section would work, but in this case as you noted you don't
need the second test eiter.
> What do you think about this patch, for example? (Untested ...)
That seems reasonable yes.
--
Alexandre Julliard
[EMAIL PROTECTED]