RE: [GD-Windows] Stopping a thread cleanly
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2002-02-18 18:56:15
|
It only needs to assume this if you're calling any other function from within that loop. Of course, Sleep(), or WaitForSingleObject(), or pretty much anything else you might want to do in the loop does count as a function call (as long as it doesn't get inlined) but I thought I'd mention it. volatile is your friend when you're using a shared-memory thread communication model. Cheers, / h+ > The compiler should always reload it unless you've specified "assume no > aliasing" (which is not the default, even in optimized builds). Since > it's not a local variable, it has to assume that pData->bKill can be > changed every time through the loop. |