|
|
@@ -144,8 +144,8 @@ namespace CodeDweller { |
|
|
|
|
|
|
|
int Service::callbackTimeout_ms = 30 * 1000;
|
|
|
|
|
|
|
|
Service::Service() :
|
|
|
|
callbacksActive(true) {
|
|
|
|
Service::Service() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Service &Service::getInstance() {
|
|
|
@@ -433,6 +433,8 @@ namespace CodeDweller { |
|
|
|
|
|
|
|
#ifdef DEBUG_LOG_FILE
|
|
|
|
std::ofstream logStream;
|
|
|
|
auto startTime = std::chrono::steady_clock::now();
|
|
|
|
|
|
|
|
logStream.open(DEBUG_LOG_FILE, std::fstream::app);
|
|
|
|
logStream << "processCtrlMessage. message: " << message << std::endl;
|
|
|
|
logStream.close();
|
|
|
@@ -457,10 +459,36 @@ namespace CodeDweller { |
|
|
|
|
|
|
|
pauseReceived = true;
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOG_FILE
|
|
|
|
startTime = std::chrono::steady_clock::now();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
for (auto callback : pauseCallbacks) {
|
|
|
|
(*callback)();
|
|
|
|
serviceStatus.dwCheckPoint++;
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOG_FILE
|
|
|
|
logStream.open(DEBUG_LOG_FILE, std::fstream::app);
|
|
|
|
logStream << "Service::processCtrlMessage. "
|
|
|
|
<< "Cumulative time after callback (ms): "
|
|
|
|
<< std::chrono::duration_cast<std::chrono::milliseconds>
|
|
|
|
(std::chrono::steady_clock::now() - startTime).count()
|
|
|
|
<< ", dwWaitHint: " << serviceStatus.dwWaitHint
|
|
|
|
<< std::endl;
|
|
|
|
logStream.close();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
(void) SetServiceStatus(serviceStatusHandle, &serviceStatus);
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOG_FILE
|
|
|
|
logStream.open(DEBUG_LOG_FILE, std::fstream::app);
|
|
|
|
logStream << "Service::processCtrlMessage. "
|
|
|
|
<< "Cumulative time after SetServiceStatus (ms): "
|
|
|
|
<< std::chrono::duration_cast<std::chrono::milliseconds>
|
|
|
|
(std::chrono::steady_clock::now() - startTime).count()
|
|
|
|
<< std::endl;
|
|
|
|
logStream.close();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
serviceStatus.dwControlsAccepted =
|
|
|
@@ -472,6 +500,15 @@ namespace CodeDweller { |
|
|
|
serviceStatus.dwCheckPoint = 0;
|
|
|
|
(void) SetServiceStatus(serviceStatusHandle, &serviceStatus);
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOG_FILE
|
|
|
|
logStream.open(DEBUG_LOG_FILE, std::fstream::app);
|
|
|
|
logStream << "Service::processCtrlMessage. "
|
|
|
|
<< "Cumulative time after final SetServiceStatus (ms): "
|
|
|
|
<< std::chrono::duration_cast<std::chrono::milliseconds>
|
|
|
|
(std::chrono::steady_clock::now() - startTime).count()
|
|
|
|
<< std::endl;
|
|
|
|
logStream.close();
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SERVICE_CONTROL_CONTINUE:
|