From: Christopher Faylor Date: Mon, 7 Oct 2002 04:12:54 +0000 (+0000) Subject: * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't need to X-Git-Tag: newlib-1_11_0~319 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=bc63ea872c24c2e362dc64b7063cc90c9b49935d;p=newlib-cygwin.git * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't need to track thread detaches. * init.cc (dll_entry): Reorganize slightly. Fix api_fatal message. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cc93104f3..9c2de0c8d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2002-10-07 Christopher Faylor + + * dcrt0.cc (do_exit): Call DisableThreadLibraryCalls since we don't + need to track thread detaches. + * init.cc (dll_entry): Reorganize slightly. Fix api_fatal message. + 2002-10-05 Christopher Faylor * cygthread.cc (cygthread::stub): Very minor cleanup. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index e3c69a6cb..4b752cf63 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -958,6 +958,10 @@ do_exit (int status) UINT n = (UINT) status; static int NO_COPY exit_state = 0; + if (!DisableThreadLibraryCalls (cygwin_hmodule)) + system_printf ("DisableThreadLibraryCalls (%p) failed, %E", + cygwin_hmodule); + syscall_printf ("do_exit (%d)", n); vfork_save *vf = vfork_storage.val (); diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc index 9c942f270..311429351 100644 --- a/winsup/cygwin/init.cc +++ b/winsup/cygwin/init.cc @@ -24,26 +24,18 @@ WINAPI dll_entry (HANDLE h, DWORD reason, void *static_load) cygwin_hmodule = (HMODULE) h; dynamically_loaded = (static_load == NULL); break; + case DLL_PROCESS_DETACH: + break; case DLL_THREAD_ATTACH: if (user_data->threadinterface) { if (!TlsSetValue (user_data->threadinterface->reent_index, &user_data->threadinterface->reents)) - api_fatal ("Sig proc MT init failed\n"); + api_fatal ("thread initialization failed"); } break; - case DLL_PROCESS_DETACH: - break; case DLL_THREAD_DETACH: -#if 0 - pthread *thisthread = (pthread *) - TlsGetValue (user_data->threadinterface->thread_self_dwTlsIndex); - if (thisthread) { - /* Some non-pthread call created this thread, - * but we need to clean it up */ - thisthread->exit (0); - } -#endif + /* not invoked */; break; } return 1;