diff options
author | Christopher Faylor <me@cgf.cx> | 2006-05-31 06:14:17 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-05-31 06:14:17 +0400 |
commit | a2b6c065460280190fbb23bceb8755eeda729bbe (patch) | |
tree | 78b6b3c7e32bb9c56baf0ba3b6d85f1d5463c966 /winsup/cygwin/cygtls.cc | |
parent | 08a968173b01ed1176b1a33f199167de2309f71c (diff) |
* 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 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 |