Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r--winsup/cygwin/init.cc30
1 files changed, 12 insertions, 18 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 5d2c75056..9c942f270 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -1,6 +1,6 @@
/* init.cc
- Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
This file is part of Cygwin.
@@ -13,8 +13,6 @@ details. */
#include "thread.h"
#include "perprocess.h"
-extern HMODULE cygwin_hmodule;
-
int NO_COPY dynamically_loaded;
extern "C" int
@@ -29,26 +27,22 @@ WINAPI dll_entry (HANDLE h, DWORD reason, void *static_load)
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");
+ 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
+#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
break;
}