소스 검색

Delay report that the service is running.

Wait until the application has been running for long enough to be exempt
from restart throttling before reporting a status of SERVICE_RUNNING to
the operating system.

Thanks Tom Saul.
Iain Patterson 12 년 전
부모
커밋
c50225935f
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      service.cpp

+ 3 - 3
service.cpp

@@ -404,13 +404,13 @@ int start_service() {
 
   close_output_handles(&si);
 
+  /* Wait for a clean startup. */
+  if (WaitForSingleObject(process_handle, throttle_delay) == WAIT_TIMEOUT) throttle = 0;
+
   /* Signal successful start */
   service_status.dwCurrentState = SERVICE_RUNNING;
   SetServiceStatus(service_handle, &service_status);
 
-  /* Wait for a clean startup. */
-  if (WaitForSingleObject(process_handle, throttle_delay) == WAIT_TIMEOUT) throttle = 0;
-
   return 0;
 }