Răsfoiți Sursa

Alexandre Oliva writes:

A program that requests __pthread_sig_debug to be blocked will
self-deadlock when it requests a thread to be created, because the
debugger (rda or gdb) will never get the signal, so it won't wake up
the pthread manager as expected.

This patch fixes it.
Eric Andersen 21 ani în urmă
părinte
comite
5f2bd77887
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      libpthread/linuxthreads/signals.c

+ 4 - 0
libpthread/linuxthreads/signals.c

@@ -38,9 +38,13 @@ int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
     case SIG_SETMASK:
     case SIG_SETMASK:
       sigaddset(&mask, __pthread_sig_restart);
       sigaddset(&mask, __pthread_sig_restart);
       sigdelset(&mask, __pthread_sig_cancel);
       sigdelset(&mask, __pthread_sig_cancel);
+      if (__pthread_sig_debug > 0)
+	sigdelset(&mask, __pthread_sig_debug);
       break;
       break;
     case SIG_BLOCK:
     case SIG_BLOCK:
       sigdelset(&mask, __pthread_sig_cancel);
       sigdelset(&mask, __pthread_sig_cancel);
+      if (__pthread_sig_debug > 0)
+	sigdelset(&mask, __pthread_sig_debug);
       break;
       break;
     case SIG_UNBLOCK:
     case SIG_UNBLOCK:
       sigdelset(&mask, __pthread_sig_restart);
       sigdelset(&mask, __pthread_sig_restart);