From 6bb281b030e930acbc3323e7c38dc53f4266aeb4 Mon Sep 17 00:00:00 2001 From: dimitr Date: Sat, 2 Feb 2008 14:42:16 +0000 Subject: [PATCH] 1) Call SRVR_shutdown() when shutting down the server process. 2) Get rid of the unnecessary sync calls. --- src/remote/os/win32/cntl.cpp | 8 ++------ src/remote/os/win32/window.cpp | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/remote/os/win32/cntl.cpp b/src/remote/os/win32/cntl.cpp index c9d44ec30f..6064993fa0 100644 --- a/src/remote/os/win32/cntl.cpp +++ b/src/remote/os/win32/cntl.cpp @@ -27,6 +27,7 @@ #include "../remote/remote.h" #include "../jrd/ThreadStart.h" #include "../utilities/install/install_nt.h" +#include "../remote/serve_proto.h" #include "../remote/os/win32/cntl_proto.h" #include "../jrd/gds_proto.h" #include "../jrd/isc_proto.h" @@ -91,12 +92,8 @@ void* CNTL_insert_thread() * Functional description * **************************************/ - THREAD_ENTER(); cntl_thread* new_thread = (cntl_thread*) ALLR_alloc((SLONG) sizeof(cntl_thread)); -/* NOMEM: ALLR_alloc() handled */ -/* FREE: in CTRL_remove_thread() */ - THREAD_EXIT(); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &new_thread->thread_handle, 0, FALSE, DUPLICATE_SAME_ACCESS); @@ -202,9 +199,7 @@ void CNTL_remove_thread(void* athread) CloseHandle(rem_thread->thread_handle); - THREAD_ENTER(); ALLR_free(rem_thread); - THREAD_EXIT(); } @@ -333,6 +328,7 @@ static THREAD_ENTRY_DECLARE cleanup_thread(THREAD_ENTRY_PARAM) } JRD_shutdown_all(false); + SRVR_shutdown(); return 0; } diff --git a/src/remote/os/win32/window.cpp b/src/remote/os/win32/window.cpp index 18f450604e..1af626ea35 100644 --- a/src/remote/os/win32/window.cpp +++ b/src/remote/os/win32/window.cpp @@ -223,6 +223,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, gds_alloc_report(ALLOC_verbose, fn, 0); #endif JRD_shutdown_all(false); + SRVR_shutdown(); DestroyWindow(hWnd); } } @@ -435,6 +436,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, } JRD_shutdown_all(false); + SRVR_shutdown(); PostMessage(hWnd, WM_DESTROY, 0, 0); return TRUE; } @@ -457,6 +459,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd, GetDriveLetter(pdbcv->dbcv_unitmask, szDrives); MessageBox(hWnd, tmp, szDrives, MB_OK | MB_ICONHAND); JRD_shutdown_all(false); + SRVR_shutdown(); PostMessage(hWnd, WM_DESTROY, 0, 0); } return TRUE;