diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/cygtls.cc | 5 |
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 |