8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 19:23:02 +01:00

1) Call SRVR_shutdown() when shutting down the server process.

2) Get rid of the unnecessary sync calls.
This commit is contained in:
dimitr 2008-02-02 14:42:16 +00:00
parent ca7815fd5b
commit 6bb281b030
2 changed files with 5 additions and 6 deletions

View File

@ -27,6 +27,7 @@
#include "../remote/remote.h" #include "../remote/remote.h"
#include "../jrd/ThreadStart.h" #include "../jrd/ThreadStart.h"
#include "../utilities/install/install_nt.h" #include "../utilities/install/install_nt.h"
#include "../remote/serve_proto.h"
#include "../remote/os/win32/cntl_proto.h" #include "../remote/os/win32/cntl_proto.h"
#include "../jrd/gds_proto.h" #include "../jrd/gds_proto.h"
#include "../jrd/isc_proto.h" #include "../jrd/isc_proto.h"
@ -91,12 +92,8 @@ void* CNTL_insert_thread()
* Functional description * Functional description
* *
**************************************/ **************************************/
THREAD_ENTER();
cntl_thread* new_thread = (cntl_thread*) ALLR_alloc((SLONG) sizeof(cntl_thread)); 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(), DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
GetCurrentProcess(), &new_thread->thread_handle, 0, FALSE, GetCurrentProcess(), &new_thread->thread_handle, 0, FALSE,
DUPLICATE_SAME_ACCESS); DUPLICATE_SAME_ACCESS);
@ -202,9 +199,7 @@ void CNTL_remove_thread(void* athread)
CloseHandle(rem_thread->thread_handle); CloseHandle(rem_thread->thread_handle);
THREAD_ENTER();
ALLR_free(rem_thread); ALLR_free(rem_thread);
THREAD_EXIT();
} }
@ -333,6 +328,7 @@ static THREAD_ENTRY_DECLARE cleanup_thread(THREAD_ENTRY_PARAM)
} }
JRD_shutdown_all(false); JRD_shutdown_all(false);
SRVR_shutdown();
return 0; return 0;
} }

View File

@ -223,6 +223,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd,
gds_alloc_report(ALLOC_verbose, fn, 0); gds_alloc_report(ALLOC_verbose, fn, 0);
#endif #endif
JRD_shutdown_all(false); JRD_shutdown_all(false);
SRVR_shutdown();
DestroyWindow(hWnd); DestroyWindow(hWnd);
} }
} }
@ -435,6 +436,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd,
} }
JRD_shutdown_all(false); JRD_shutdown_all(false);
SRVR_shutdown();
PostMessage(hWnd, WM_DESTROY, 0, 0); PostMessage(hWnd, WM_DESTROY, 0, 0);
return TRUE; return TRUE;
} }
@ -457,6 +459,7 @@ LRESULT CALLBACK WindowFunc(HWND hWnd,
GetDriveLetter(pdbcv->dbcv_unitmask, szDrives); GetDriveLetter(pdbcv->dbcv_unitmask, szDrives);
MessageBox(hWnd, tmp, szDrives, MB_OK | MB_ICONHAND); MessageBox(hWnd, tmp, szDrives, MB_OK | MB_ICONHAND);
JRD_shutdown_all(false); JRD_shutdown_all(false);
SRVR_shutdown();
PostMessage(hWnd, WM_DESTROY, 0, 0); PostMessage(hWnd, WM_DESTROY, 0, 0);
} }
return TRUE; return TRUE;