1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Fixed bugs in thread termination code.

This commit is contained in:
Daniel Collins 2011-09-08 23:00:52 +00:00
parent f837ac123d
commit 6e94ae1a6b
3 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,7 @@ SRC_FILES := changes.txt license.txt Makefile mkstubs.pl readme.txt src/config.h
all: ipxwrapper.dll wsock32.dll mswsock.dll ipxconfig.exe dpwsockx.dll
clean:
rm -f ipxwrapper.dll wsock32.dll mswsock.dll ipxconfig.exe
rm -f ipxwrapper.dll wsock32.dll mswsock.dll ipxconfig.exe dpwsockx.dll
rm -f src/*.o src/*_stubs.s
dist: all

View File

@ -413,6 +413,7 @@ static HRESULT WINAPI IPX_ShutdownEx(LPDPSP_SHUTDOWNDATA data) {
TerminateThread(sp_data->worker_thread, 0);
}
CloseHandle(sp_data->worker_thread);
sp_data->worker_thread = NULL;
}

View File

@ -114,7 +114,12 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
LeaveCriticalSection(&(router->crit_sec));
WaitForSingleObject(router_thread, INFINITE);
if(WaitForSingleObject(router_thread, 3000) == WAIT_TIMEOUT) {
log_printf("Router thread didn't exit in 3 seconds, killing");
TerminateThread(router_thread, 0);
}
CloseHandle(router_thread);
router_thread = NULL;
router_destroy(router);