FreeBSD/contrib/subversion/subversion/svnserve/winservice.c
/* main() calls this function in order to notify the SCM that the
   service has stopped.  This function also handles cleaning up the
   dispatcher thread (the one that we created above in
   winservice_start. */
main() calls this function in order to notify the SCM that the
service has stopped.  This function also handles cleaning up the
dispatcher thread (the one that we created above in
winservice_start.
main () calls this function in order to notify the SCM that the service has stopped . This function also handles cleaning up the dispatcher thread ( the one that we created above in winservice_start .
static void
winservice_stop(DWORD exit_code)
{
  dbg_print("winservice_stop - notifying SCM that service has stopped\r\n");
  winservice_status.dwCurrentState = SERVICE_STOPPED;
  winservice_status.dwWin32ExitCode = exit_code;
  winservice_update_state();
  if (winservice_dispatcher_thread != NULL)
    {
      dbg_print("waiting for dispatcher thread to exit...\r\n");
      WaitForSingleObject(winservice_dispatcher_thread, INFINITE);
      dbg_print("dispatcher thread has exited.\r\n");
      CloseHandle(winservice_dispatcher_thread);
      winservice_dispatcher_thread = NULL;
    }
  else
    {
      exit_code = winservice_status.dwWin32ExitCode;
      dbg_print("dispatcher thread was not running\r\n");
    }
  if (winservice_start_event != NULL)
    {
      CloseHandle(winservice_start_event);
      winservice_start_event = NULL;
    }
  dbg_print("winservice_stop - service has stopped\r\n");
}
static void winservice_stop ( DWORD exit_code ) { dbg_print ( " \r \n " ) ; winservice_status . dwCurrentState = SERVICE_STOPPED ; winservice_status . dwWin32ExitCode = exit_code ; winservice_update_state ( ) ; if ( winservice_dispatcher_thread != NULL ) { dbg_print ( " \r \n " ) ; WaitForSingleObject ( winservice_dispatcher_thread , INFINITE ) ; dbg_print ( " \r \n " ) ; CloseHandle ( winservice_dispatcher_thread ) ; winservice_dispatcher_thread = NULL ; } else { exit_code = winservice_status . dwWin32ExitCode ; dbg_print ( " \r \n " ) ; } if ( winservice_start_event != NULL ) { CloseHandle ( winservice_start_event ) ; winservice_start_event = NULL ; } dbg_print ( " \r \n " ) ; }
main() calls this function in order to notify the SCM that the
service has stopped.
main () calls this function in order to notify the SCM that the service has stopped .
/* There was no dispatcher thread.  So we never started in
         the first place. */