...
Consider, for example, two threads that call toggle()
. The expected effect of toggling flag
twice is to restore that it is restored to its original value. However, the following scenario leaves flag
in the incorrect state:
...
...
Consider, for example, two threads that call toggle()
. The expected effect of toggling flag
twice is to restore that it is restored to its original value. However, the following scenario leaves flag
in the incorrect state:
...