| Index: src/engine/main.cpp | 
| =================================================================== | 
| --- a/src/engine/main.cpp | 
| +++ b/src/engine/main.cpp | 
| @@ -8,6 +8,7 @@ | 
| #include "../shared/Dictionary.h" | 
| #include "../shared/Utils.h" | 
| #include "../shared/Version.h" | 
| +#include "../shared/CriticalSection.h" | 
| #include "Debug.h" | 
| #include "Updater.h" | 
| @@ -38,6 +39,9 @@ | 
| << subscription->IsListed(); | 
| } | 
| } | 
| + | 
| + CriticalSection firstRunLock; | 
| + bool firstRunActionTaken = false; | 
| Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) | 
| { | 
| @@ -167,11 +171,16 @@ | 
| } | 
| break; | 
| } | 
| - case Communication::PROC_GET_IS_FIRST_RUN: | 
| + case Communication::PROC_IS_FIRST_RUN_ACTION_NEEDED: | 
| + { | 
| + CriticalSection::Lock lock(firstRunLock); | 
| + if (!firstRunActionTaken && filterEngine->IsFirstRun()) | 
| { | 
| - response << filterEngine->IsFirstRun(); | 
| - break; | 
| + response << !firstRunActionTaken; | 
| 
 
Wladimir Palant
2013/07/21 11:53:45
How about just response << true? No point obscurin
 
 | 
| + firstRunActionTaken = true; | 
| } | 
| 
 
Wladimir Palant
2013/07/21 11:53:45
What about:
else
  response << false;
Shouldn't
 
 | 
| + break; | 
| + } | 
| } | 
| return response; |