diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-31 02:14:17 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-31 02:14:17 +0000 |
commit | a2b6c065460280190fbb23bceb8755eeda729bbe (patch) | |
tree | 78b6b3c7e32bb9c56baf0ba3b6d85f1d5463c966 /winsup/cygwin/cygtls.cc | |
parent | 08a968173b01ed1176b1a33f199167de2309f71c (diff) | |
download | newlib-a2b6c065460280190fbb23bceb8755eeda729bbe.zip newlib-a2b6c065460280190fbb23bceb8755eeda729bbe.tar.gz newlib-a2b6c065460280190fbb23bceb8755eeda729bbe.tar.bz2 |
* cygtls.cc (_cygtls::call2): Don't call ExitThread on the main thread.
Diffstat (limited to 'winsup/cygwin/cygtls.cc')
-rw-r--r-- | winsup/cygwin/cygtls.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index d3a6756..8dd15ad 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 |