aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/thread.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-11-28 12:10:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-11-28 12:10:12 +0000
commit9d2eff668454d6ef3b09064af73c6fa5186fd049 (patch)
tree526c9ddbac79419ee9cb8440bc424bdd84c6ddbc /winsup/cygwin/thread.cc
parentb3281dd194f6cf8f908cf4ae8b8ca41ee2e981df (diff)
downloadnewlib-9d2eff668454d6ef3b09064af73c6fa5186fd049.zip
newlib-9d2eff668454d6ef3b09064af73c6fa5186fd049.tar.gz
newlib-9d2eff668454d6ef3b09064af73c6fa5186fd049.tar.bz2
* cygheap.cc (init_cygheap::find_tls): Add comment.
* cygtls.cc (well_known_dlls): Rephrase comment. (bloda_detect): New function. (_cygtls::call2): Call init_thread and bloda_detect for non-pthread threads only. (_cygtls::remove): Move remove_tls and remove_wq calls up to run first. * miscfuncs.cc (struct pthread_wrapper_arg): Rename from struct thread_wrapper_arg. (pthread_wrapper): Rename from thread_wrapper and drop "static". Fix comment. Drop call to _cygtls::remove. Call api_fatal rather than ExitThread. Explain why. * miscfuncs.h (pthread_wrapper): Declare pthread_wrapper. * thread.cc (pthread::exit): Add a FIXME comment. Call _cygtls::remove before calling ExitThread.
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index f801d59..a2e2aeb 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -543,11 +543,13 @@ pthread::exit (void *value_ptr)
{
if (is_main_tls)
{
+ /* FIXME: Needs locking. */
_cygtls *dummy = (_cygtls *) malloc (sizeof (_cygtls));
*dummy = *_main_tls;
_main_tls = dummy;
- _main_tls->initialized = false;
+ _main_tls->initialized = 0;
}
+ cygtls->remove (INFINITE);
ExitThread (0);
}
}