summaryrefslogtreecommitdiffstats
path: root/libpthread/linuxthreads/pthread.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-01-29 14:20:10 +0000
committerEric Andersen <andersen@codepoet.org>2005-01-29 14:20:10 +0000
commitbadf6dd685a37f85be05720797cf675c4d58846c (patch)
tree72cdf8cfb4f0f30841b7291759bd298b69693db3 /libpthread/linuxthreads/pthread.c
parent0e2bf1ef11e27dea207747a0480823a3e4a06217 (diff)
downloaduClibc-alpine-badf6dd685a37f85be05720797cf675c4d58846c.tar.bz2
uClibc-alpine-badf6dd685a37f85be05720797cf675c4d58846c.tar.xz
Hi Erik and Manuel
Long time no see :) It appears uClibc pthreads native debugging is broken w.r.t thread exit handling in uClibc(at least on PPC). When debugging ex7, gdb(6.2.1) bails out as soon as a thread exits. I found a comment in gdb that TD_DEATH handling was broken for glibc 2.3.1, so I figured that maybe it was broken in uClibc also. I added a #if 0 #endif in pthread_exit( see patch below) and then gdb behaved again. While looking into this I found a few differences( included in the patch) between glibc and uClibc. Don't know if these makes a difference, but I leave that to you to decide. Jocke
Diffstat (limited to 'libpthread/linuxthreads/pthread.c')
-rw-r--r--libpthread/linuxthreads/pthread.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index c4225bce8..2615fe724 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -376,6 +376,7 @@ static void pthread_initialize(void)
sa.sa_flags = 0;
__libc_sigaction(__pthread_sig_restart, &sa, NULL);
sa.sa_handler = pthread_handle_sigcancel;
+ sigaddset(&sa.sa_mask, __pthread_sig_restart);
// sa.sa_flags = 0;
__libc_sigaction(__pthread_sig_cancel, &sa, NULL);
if (__pthread_sig_debug > 0) {
@@ -388,6 +389,10 @@ static void pthread_initialize(void)
sigemptyset(&mask);
sigaddset(&mask, __pthread_sig_restart);
sigprocmask(SIG_BLOCK, &mask, NULL);
+ /* And unblock __pthread_sig_cancel if it has been blocked. */
+ sigdelset(&mask, __pthread_sig_restart);
+ sigaddset(&mask, __pthread_sig_cancel);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
/* Register an exit function to kill all other threads. */
/* Do it early so that user-registered atexit functions are called
before pthread_onexit_process. */