From 3f5046a540af860ee6045156becbeb71fa05b220 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 13 Oct 2002 18:16:33 +0000 Subject: * cygthread.cc (cygthread::stub): Don't create event for long-running threads. Initialize thread_sync event here which is used to Suspend using an event rather than relying on SuspendThread/ResumeThread. (cygthread::init): Save handle to runner thread for future termination. (cygthread::cygthread): Only resume thread when it is actually suspended. Otherwise signal thread completion event. (cygthread::terminate): Forcibly terminate runner thread and any helper threads. Call DisableThreadLibrary calls if execing. * cygthread.h (cygthread::thread_sync): Declare. * dcrt0.cc (do_exit): Eliminate calls to obsolete window_terminate and shared_terminate. * exceptions.cc (events_terminate): Don't bother closing title_mutex since it is going away anyway. * pinfo.cc (_pinfo::exit): Call cygthread::terminate to ensure that threads are shut down before process exit or otherwise strange races seem to occur. * shared.cc (shared_terminate): Eliminate. * shared.h (shared_terminate): Eliminate declaration. * winsup.h (window_terminate): Eliminate declaration. * spawn.cc (spawn_guts): Call cygthread::terminate early in process if execing. Call DisableThreadLibrary calls if execing. * window.cc (Winmain): Call ExitThread to force exit. (window_terminate): Eliminate. * dcrt0.cc (do_exit): Track exit state more closely. --- winsup/cygwin/window.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'winsup/cygwin/window.cc') diff --git a/winsup/cygwin/window.cc b/winsup/cygwin/window.cc index 7c67fae26..80e95a143 100644 --- a/winsup/cygwin/window.cc +++ b/winsup/cygwin/window.cc @@ -121,7 +121,7 @@ Winmain (VOID *) while (GetMessage (&msg, ourhwnd, 0, 0) == TRUE) DispatchMessage (&msg); - return msg.wParam; + ExitThread (0); } HWND __stdcall @@ -141,13 +141,6 @@ gethwnd () return ourhwnd; } -void __stdcall -window_terminate () -{ - if (ourhwnd) - SendMessage (ourhwnd, WM_DESTROY, 0, 0); -} - extern "C" int setitimer (int which, const struct itimerval *value, struct itimerval *oldvalue) { -- cgit v1.2.3