From: Ulrich Drepper Date: Fri, 20 Aug 1999 19:01:29 +0000 (+0000) Subject: (__pthread_kill_other_threads_np): Reset signal handlers for the X-Git-Tag: cvs/glibc_2-1-2~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2e1ff28894a7b02960d4f0449d2046ccaa183a8;p=thirdparty%2Fglibc.git (__pthread_kill_other_threads_np): Reset signal handlers for the signals we used in the thread implementation here. --- diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c index b2c0981abd6..9a21c5cb3f9 100644 --- a/linuxthreads/pthread.c +++ b/linuxthreads/pthread.c @@ -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)