diff --git a/checkin_notes b/checkin_notes index 1a41c56c89..19cf9d1f0c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7463,3 +7463,14 @@ David 11 July 2006 log_flags.C,h lib/ parse.C + +David 11 July 2006 + - core client, Windows: don't call finalize() in quit_client(); + quit_client() is run in a different thread, apparently, + and we can't safely do anything in that thread. + Instead, have it set a flag telling the main thread to exit, + then do a sleep loop until the main thread has exited. + (Windows... you gotta love it). + + client/ + main.C diff --git a/client/main.C b/client/main.C index 7e1ddc9976..6d3014777c 100644 --- a/client/main.C +++ b/client/main.C @@ -30,6 +30,7 @@ extern HINSTANCE g_hClientLibraryDll; static HANDLE g_hWin9xMonitorSystemThread = NULL; static DWORD g_Win9xMonitorSystemThreadID = NULL; static BOOL g_bIsWin9x = FALSE; +static bool main_thread_exited = false; typedef BOOL (*pfnIsWindows2000Compatible)(); typedef BOOL (CALLBACK* ClientLibraryStartup)(); @@ -129,7 +130,10 @@ void show_message(PROJECT *p, char* msg, int priority) { #ifdef WIN32 void quit_client() { gstate.requested_exit = true; - finalize(); + while (1) { + boinc_sleep(1.0); + if (main_thread_exited) break; + } } void suspend_client() { @@ -542,7 +546,10 @@ int boinc_main_loop() { DosSleep(0); #endif } - return finalize(); + finalize(); +#ifdef _WIN32 + main_thread_exited = true; +#endif } int finalize() { diff --git a/doc/client_msgs.php b/doc/client_msgs.php index bdcf861fad..e042063b03 100644 --- a/doc/client_msgs.php +++ b/doc/client_msgs.php @@ -8,9 +8,11 @@ The core client reads configuration options from a file This file has the following format: ".html_text(" - [ N ] - [ 0|1 ] - [ N ] + + [ N ] + [ 0|1 ] + [ N ] + [ flags ]