Index: cygwin/debug.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/debug.cc,v retrieving revision 1.18 diff -u -3 -p -r1.18 debug.cc --- cygwin/debug.cc 2001/03/03 03:56:34 1.18 +++ cygwin/debug.cc 2001/04/16 11:04:33 @@ -89,6 +89,13 @@ thread_stub (VOID *arg) /* Give up our slot in the start_buf array */ (void) InterlockedExchange (&((thread_start *) arg)->notavail, 0); + if (user_data->threadinterface) + { + if (!TlsSetValue(user_data->threadinterface->reent_index, + &user_data->threadinterface->reents)) + api_fatal("Sig proc MT init failed\n"); + } + /* Initialize this thread's ability to respond to things like SIGSEGV or SIGFPE. */ init_exceptions (&except_entry); Index: cygwin/init.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/init.cc,v retrieving revision 1.11 diff -u -3 -p -r1.11 init.cc --- cygwin/init.cc 2000/09/08 02:56:54 1.11 +++ cygwin/init.cc 2001/04/16 11:04:33 @@ -25,31 +25,18 @@ WINAPI dll_entry (HANDLE h, DWORD reason case DLL_PROCESS_ATTACH: cygwin_hmodule = (HMODULE) h; dynamically_loaded = (static_load == NULL); + + /* Tell the system to not send DLL_THREAD_ATTACH and + DLL_THREAD_DETACH notifications to dll_entry. Therfore, + performance is increased by reducing overhead and avoiding + serialization when creating and destroying threads. */ + DisableThreadLibraryCalls(cygwin_hmodule); 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"); - } break; case DLL_PROCESS_DETACH: break; case DLL_THREAD_DETACH: -#if 0 // FIXME: REINSTATE SOON - waitq *w; - if ((w = waitq_storage.get ()) != NULL) - { - if (w->thread_ev != NULL) - { - system_printf ("closing %p", w->thread_ev); - (void) CloseHandle (w->thread_ev); - } - memset (w, 0, sizeof(*w)); // FIXME: memory leak - } - // FIXME: Need to add other per_thread stuff here -#endif break; } return 1;