Hey Jeff, Yes, they are all local variables, but the reason to move up the 'EnterCriticalSection' is not to protect race conditions, obviously there is no race conditions for local variables. The reason is to preserve the right order to update the 'curPerfCounter' and 'lastPerfCounter', we must guarantee that the 'lastPerfCounter' is always updated at the end of the last iteration, and 'curPerfCounter' is updated at the beginning of a new iteration. But I found this issue: 1. Thread A executes currentTime::expire() from line 425 to line 439, it has already filled the local variable 'curPerfCounter' (say 10001) and wait to enter the critical section which is currently obtained by Thread B. 2. Thread B executes currentTime::getCurrentTime(), it updates the 'lastPerfCounter' (say 10009) at line 402 within the critical section, then thread B exits the critical section. 3. Thread A gets the chance to enter the critial section just released by thread B, but it finds the 'lastPerfCounter' is bigger than the 'curPerfCounter', so it will handle it as a roll over case, but it's actually not a real roll over case. I found this issue on NI's PharLap platform(a sort of realtime Windows), but I think it could show up on other platforms as well during concurrency situations. BTW, the big headache for me is actually not this bug, but Bug 697516 which throws a std::logic_error exception and causes system to crash. Thanks, Alex From: Jeff Hill