Thomas Weidenmueller wrote:
gedmurphy(a)svn.reactos.com wrote:
Improve stopping control of the service
@@ -137,14 +137,14 @@
{
case SERVICE_CONTROL_SHUTDOWN: /* fall through */
case SERVICE_CONTROL_STOP:
- bShutDownFlag = TRUE;
+ bShutDown = TRUE;
UpdateStatus(SERVICE_STOP_PENDING, -1);
break;
case SERVICE_CONTROL_PAUSE:
- bPauseFlag = TRUE;
+ bPause = TRUE;
break;
case SERVICE_CONTROL_CONTINUE:
- bPauseFlag = FALSE;
+ bPause = FALSE;
You might want to use InterlockedExchange to make it thread-safe.
- Thomas
Hi Thomas.
Could you explain what you mean?
Those variables are only modified within the base thread, all other
threads just check the value and act upon it.
Why would that not be thread safe?
Thanks,
Ged.