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:
authorChristopher Faylor <me@cgf.cx>2006-05-31 06:14:17 +0400
committerChristopher Faylor <me@cgf.cx>2006-05-31 06:14:17 +0400
commita2b6c065460280190fbb23bceb8755eeda729bbe (patch)
tree78b6b3c7e32bb9c56baf0ba3b6d85f1d5463c966
parent08a968173b01ed1176b1a33f199167de2309f71c (diff)
* cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/cygtls.cc5
2 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 34b4ff39e..dd1ab484d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2006-05-30 Christopher Faylor <cgf@timesys.com>
+
+ * cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
+
2006-05-29 Christopher Faylor <cgf@timesys.com>
* winf.h (MAXCYGWINCMDLEN): Set down size to 30000 or suffer fork
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index d3a67565b..8dd15ad6e 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -73,7 +73,10 @@ _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf)
init_thread (buf, func);
DWORD res = func (arg, buf);
remove (INFINITE);
- ExitThread (res);
+ /* Don't call ExitThread on the main thread since we may have been
+ dynamically loaded. */
+ if (this != _main_tls)
+ ExitThread (res);
}
void