]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__pthread_kill_other_threads_np): Reset signal handlers for the
authorUlrich Drepper <drepper@redhat.com>
Fri, 20 Aug 1999 19:01:29 +0000 (19:01 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 20 Aug 1999 19:01:29 +0000 (19:01 +0000)
signals we used in the thread implementation here.

linuxthreads/pthread.c

index b2c0981abd61f499f0d17101830b39ac09fd37e3..9a21c5cb3f9f1faf0d0e484f83b9996baa8fc36a 100644 (file)
@@ -661,11 +661,22 @@ void __pthread_reset_main_thread()
 
 void __pthread_kill_other_threads_np(void)
 {
+  struct sigaction sa;
   /* Terminate all other threads and thread manager */
   pthread_exit_process(0, NULL);
   /* Make current thread the main thread in case the calling thread
      changes its mind, does not exec(), and creates new threads instead. */
   __pthread_reset_main_thread();
+  /* Reset the signal handlers behaviour for the signals the
+     implementation uses since this would be passed to the new
+     process.  */
+  sigemptyset(&sa.sa_mask);
+  sa.sa_flags = 0;
+  sa.sa_handler = SIG_DFL;
+  __sigaction(__pthread_sig_restart, &sa, NULL);
+  __sigaction(__pthread_sig_cancel, &sa, NULL);
+  if (__pthread_sig_debug > 0)
+    __sigaction(__pthread_sig_debug, &sa, NULL);
 }
 weak_alias (__pthread_kill_other_threads_np, pthread_kill_other_threads_np)