(service_main,main,shutdown) [_WIN32]: Add missing loc_NTTerm().

(service_main,main,shutdown,empth_exit,service_stopped) [_WIN32]:
Add shutdown Event to allow the service to shutdown.
When SERVICE_STOPPED is passed to SetServiceStatus() all
threads are kills this prevents shutdown() from executing.
The shutdown Event is used to block the service_main thread until
the stopping of the service is started.  After the shutdown() is
complete then the SetServiceStatus() is called.
This commit is contained in:
Ron Koenderink 2005-03-12 04:35:09 +00:00
parent 6c7f707b76
commit 014d005c69
3 changed files with 42 additions and 36 deletions

View file

@ -473,9 +473,7 @@ empth_exit(void)
/* The main line. Wait forever. */
while (1) {
if (daemonize) {
if (service_stopped())
shutdwn(0);
Sleep(3);
service_stopped();
} else {
char buf[20];
printf("\nEmpire Server>");