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

Robert Millan rmh at alioth.debian.org
Tue Apr 3 05:40:55 UTC 2012


Author: rmh
Date: 2012-04-03 05:40:54 +0000 (Tue, 03 Apr 2012)
New Revision: 4170

Modified:
   trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c
   trunk/glibc-ports/kfreebsd/nptl/timer_routines.c
Log:
Replace sigprocmask() with pthread_sigmask(). sigprocmask() results are undefined on multi-thread processes.

Modified: trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c
===================================================================
--- trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c	2012-04-02 20:23:19 UTC (rev 4169)
+++ trunk/glibc-ports/kfreebsd/linuxthreads/timer_routines.c	2012-04-03 05:40:54 UTC (rev 4170)
@@ -60,7 +60,7 @@
      signals.  */
   sigset_t ss;
   sigemptyset (&ss);
-  sigprocmask (SIG_SETMASK, &ss, NULL);
+  pthread_sigmask (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);
-  sigprocmask (SIG_SETMASK, &ss, &oss);
+  pthread_sigmask (SIG_SETMASK, &ss, &oss);
 
   sem_init (&__helper_tid_semaphore, 0, 0);
 
@@ -198,7 +198,7 @@
     sem_wait (&__helper_tid_semaphore);
 
   /* Restore the signal mask.  */
-  sigprocmask (SIG_SETMASK, &oss, NULL);
+  pthread_sigmask (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-02 20:23:19 UTC (rev 4169)
+++ trunk/glibc-ports/kfreebsd/nptl/timer_routines.c	2012-04-03 05:40:54 UTC (rev 4170)
@@ -56,7 +56,7 @@
      signals.  */
   sigset_t ss;
   sigemptyset (&ss);
-  sigprocmask (SIG_SETMASK, &ss, NULL);
+  pthread_sigmask (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);
-  sigprocmask (SIG_SETMASK, &ss, &oss);
+  pthread_sigmask (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.  */
-  sigprocmask (SIG_SETMASK, &oss, NULL);
+  pthread_sigmask (SIG_SETMASK, &oss, NULL);
 
   /* No need for the attribute anymore.  */
   (void) pthread_attr_destroy (&attr);




More information about the Glibc-bsd-commits mailing list