[ros-dev] Re: [ros-diffs] [gedmurphy] 19312: Improve stopping control of the service

Ged Murphy gedmurphy at gmail.com
Fri Nov 18 00:02:09 CET 2005


Thomas Weidenmueller wrote:
> gedmurphy at 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.



More information about the Ros-dev mailing list