diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-08-24 15:18:17 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-08-24 15:18:17 +0000 |
commit | 929a140824b8150683df0ce1f8bef0beec3a7f6c (patch) | |
tree | acd35b23ce77377ffdfc5fbc934f697bd6706afa | |
parent | 8323a37d5d8987f766001221b99395b8a7a39751 (diff) | |
download | newlib-929a140824b8150683df0ce1f8bef0beec3a7f6c.zip newlib-929a140824b8150683df0ce1f8bef0beec3a7f6c.tar.gz newlib-929a140824b8150683df0ce1f8bef0beec3a7f6c.tar.bz2 |
* thread.cc (pthread::pthread): Drop setting parent_tls. Call
sigprocmask to copy parent thread signal mask into new parent_sigmask
member.
(pthread::thread_init_wrapper): Copy _my_tls.sigmask from new
parent_sigmask member.
* thread.h (class pthread): Drop parent_tls. Add parent_sigmask.
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/thread.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/thread.h | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0eb9dcf..1308ffa 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2011-08-24 Corinna Vinschen <corinna@vinschen.de> + + * thread.cc (pthread::pthread): Drop setting parent_tls. Call + sigprocmask to copy parent thread signal mask into new parent_sigmask + member. + (pthread::thread_init_wrapper): Copy _my_tls.sigmask from new + parent_sigmask member. + * thread.h (class pthread): Drop parent_tls. Add parent_sigmask. + 2011-08-24 Christopher Faylor <me.cygwin2011@cgf.cx> * thread.cc (pthread::exit): Create dummy tls structure to hold diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 953e0c9..2f7d794 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -382,7 +382,7 @@ pthread::pthread ():verifyable_object (PTHREAD_MAGIC), win32_obj_id (0), { if (this != pthread_null::get_null_pthread ()) threads.insert (this); - parent_tls = &_my_tls; + sigprocmask (SIG_SETMASK, NULL, &parent_sigmask); } pthread::~pthread () @@ -1985,7 +1985,7 @@ pthread::thread_init_wrapper (void *arg) // if thread is detached force cleanup on exit if (thread->attr.joinable == PTHREAD_CREATE_DETACHED && thread->joiner == NULL) thread->joiner = thread; - _my_tls.sigmask = thread->parent_tls->sigmask; + _my_tls.sigmask = thread->parent_sigmask; thread->mutex.unlock (); thread_printf ("started thread %p %p %p %p %p %p", arg, &_my_tls.local_clib, diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h index 76997d6..a6e53a1 100644 --- a/winsup/cygwin/thread.h +++ b/winsup/cygwin/thread.h @@ -444,7 +444,7 @@ private: DWORD thread_id; __pthread_cleanup_handler *cleanup_stack; pthread_mutex mutex; - _cygtls *parent_tls; + sigset_t parent_sigmask; void suspend_except_self (); void resume (); |