[Glibc-bsd-commits] r4187 - in trunk/glibc-ports/kfreebsd: linuxthreads nptl

Robert Millan rmh at alioth.debian.org
Tue Apr 10 10:13:35 UTC 2012


Author: rmh
Date: 2012-04-10 10:13:35 +0000 (Tue, 10 Apr 2012)
New Revision: 4187

Modified:
   trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c
   trunk/glibc-ports/kfreebsd/nptl/timer_routines.c
Log:
Revert commit 4170, based on advice from Petr Salinger:

While in general it is a correct change, the situation inside library implementing libc/libpthread/librt is slightly different.

linuxthreads/signals.c:

int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)

   /* Don't allow __pthread_sig_restart to be unmasked.
      Don't allow __pthread_sig_cancel to be masked. */


At least inside __start_helper_thread __sigprocmask() should be used, othewise:

kfreebsd/linuxthreads/timer_routines.c:

 /* Block all signals in the helper thread but SIGSETXID.  To do this
    thoroughly we temporarily have to block all signals here.  The
    helper can lose wakeups if SIGCANCEL is not blocked throughout,
    but sigfillset omits it SIGSETXID.  So, we add SIGCANCEL back
    explicitly here.  */



Modified: trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c
===================================================================
--- trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c	2012-04-09 22:58:58 UTC (rev 4186)
+++ trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c	2012-04-10 10:13:35 UTC (rev 4187)
@@ -60,7 +60,7 @@
      signals.  */
   sigset_t ss;
   sigemptyset (&ss);
-  pthread_sigmask (SIG_SETMASK, &ss, NULL);
+  sigprocmask (SIG_SETMASK, &ss, NULL);
 
   struct thread_start_data *td = (struct thread_start_data *) arg;
 
@@ -186,7 +186,7 @@
   sigset_t oss;
   sigfillset (&ss);
   __sigaddset (&ss, SIGCANCEL);
-  pthread_sigmask (SIG_SETMASK, &ss, &oss);
+  sigprocmask (SIG_SETMASK, &ss, &oss);
 
   sem_init (&__helper_tid_semaphore, 0, 0);
 
@@ -198,7 +198,7 @@
     sem_wait (&__helper_tid_semaphore);
 
   /* Restore the signal mask.  */
-  pthread_sigmask (SIG_SETMASK, &oss, NULL);
+  sigprocmask (SIG_SETMASK, &oss, NULL);
 
   /* No need for the attribute anymore.  */
   (void) pthread_attr_destroy (&attr);

Modified: trunk/glibc-ports/kfreebsd/nptl/timer_routines.c
===================================================================
--- trunk/glibc-ports/kfreebsd/nptl/timer_routines.c	2012-04-09 22:58:58 UTC (rev 4186)
+++ trunk/glibc-ports/kfreebsd/nptl/timer_routines.c	2012-04-10 10:13:35 UTC (rev 4187)
@@ -56,7 +56,7 @@
      signals.  */
   sigset_t ss;
   sigemptyset (&ss);
-  pthread_sigmask (SIG_SETMASK, &ss, NULL);
+  sigprocmask (SIG_SETMASK, &ss, NULL);
 
   struct thread_start_data *td = (struct thread_start_data *) arg;
 
@@ -182,7 +182,7 @@
   sigset_t oss;
   sigfillset (&ss);
   __sigaddset (&ss, SIGCANCEL);
-  pthread_sigmask (SIG_SETMASK, &ss, &oss);
+  sigprocmask (SIG_SETMASK, &ss, &oss);
 
   /* Create the helper thread for this timer.  */
   pthread_t th;
@@ -192,7 +192,7 @@
     __helper_tid = ((struct pthread *) th)->tid;
 
   /* Restore the signal mask.  */
-  pthread_sigmask (SIG_SETMASK, &oss, NULL);
+  sigprocmask (SIG_SETMASK, &oss, NULL);
 
   /* No need for the attribute anymore.  */
   (void) pthread_attr_destroy (&attr);




More information about the Glibc-bsd-commits mailing list