RE: [GD-Windows] Stopping a thread cleanly
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-02-17 20:24:53
|
> In this case the compiler could put bExit in a register due > to optimisation which obviously isn't good. This is actually why this came up. When I looked at my original code, it was basically doing this: while ( 1 ) { ... if ( pData->bKill ) break; ... } I was more than a little concerned that the compiler wasn't reloading pData->bKill in some instances, because there were sections of code where no function calls were occurring but bKill was being checked multiple times. I was going to do the knee jerk thing of specing it as volatile, but decided to go with WFSO instead. Brian |