(main,print_usage) [_WIN32]: Add the ability to enable

empire thread debugging for Windows build.

(empth_select) [_WIN32]: Fix empth_select() so can be aborted.
The bug was that a command would not be aborted during an update.
The problem was select() was not interrupt by the setting of the
signalling wakeup event.  Fix by replacing the select() with
WSAEventSelect().

(empth_exit) [_WIN32]:
Fix the shutdown sequence for Windows build to be running in
empth_t context.  Add a loc_RunThisThread() in empth_exit()
before starting the shutdown() sequence.
This commit is contained in:
Ron Koenderink 2005-03-13 21:53:23 +00:00
parent 1f9b34dfdd
commit 1bbd7e5342
3 changed files with 49 additions and 74 deletions

View file

@ -234,19 +234,21 @@ service_stopped(void)
{
if (hShutdownEvent != NULL) {
WaitForSingleObject(hShutdownEvent,INFINITE);
shutdwn(0);
logerror("Service stopped");
service_status.dwWin32ExitCode = 0;
service_status.dwCurrentState = SERVICE_STOPPED;
service_status.dwCheckPoint = 0;
service_status.dwWaitHint = 0;
if (!SetServiceStatus (service_status_handle,
&service_status)) {
logerror("Error while stopping service SetServiceStatus"
" error %ld", GetLastError());
}
}
}
void
stop_service(void)
{
logerror("Service stopped");
service_status.dwWin32ExitCode = 0;
service_status.dwCurrentState = SERVICE_STOPPED;
service_status.dwCheckPoint = 0;
service_status.dwWaitHint = 0;
if (!SetServiceStatus (service_status_handle, &service_status))
logerror("Error while stopping service SetServiceStatus"
" error %ld", GetLastError());
}
#endif /* _WIN32 */