Skip to content
Snippets Groups Projects
Commit ef3e7790 authored by rswindell's avatar rswindell
Browse files

services_terminate() now closes all open service sockets, making shutdown

much faster.
parent cd982a30
No related branches found
No related tags found
No related merge requests found
......@@ -1154,7 +1154,15 @@ static void native_service_thread(void* arg)
void DLLCALL services_terminate(void)
{
DWORD i;
terminated=TRUE;
for(i=0;i<services;i++) {
if(service[i].socket==INVALID_SOCKET)
continue;
close_socket(service[i].socket);
service[i].socket=INVALID_SOCKET;
}
}
#define NEXT_FIELD(p) while(*p && *p>' ') p++; while(*p && *p<=' ') p++;
......@@ -1520,6 +1528,10 @@ void DLLCALL services_thread(void* arg)
if(service[i].socket>high_socket)
high_socket=service[i].socket;
}
if(high_socket==0) { /* No dynamic services? */
YIELD();
continue;
}
tv.tv_sec=startup->sem_chk_freq;
tv.tv_usec=0;
if((result=select(high_socket+1,&socket_set,NULL,NULL,&tv))<1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment