This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-766-g1ba1d8a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  1ba1d8a44d244110c1f8d768f098ac44351acb76 (commit)
       via  ad4f43a2344864ae2304060dcc722a7a63bad1b4 (commit)
      from  d0212d429da889345978546f215ce62a5f0e007a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1ba1d8a44d244110c1f8d768f098ac44351acb76

commit 1ba1d8a44d244110c1f8d768f098ac44351acb76
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Nov 6 09:31:37 2017 -0200

    Optimize sigrelse implementation
    
    This patch simplifies sighold a bit by removing an extra sigprocmask
    and using SIG_BLOCK (which union of the current set and the set argument).
    
    Checked on x86_64-linux-gnu.
    
    	* signal/sighold.c (sighold): Optimize implementation.
    
    Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

diff --git a/ChangeLog b/ChangeLog
index 6f10dd9..88f3ac8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-11-15  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+	* signal/sigrelse.c (sigrelse): Optimize implementation.
+
 	* sysdeps/posix/sigpause.c (do_sigpause): Remove.
 	(__sigpause): Rely on __sigsuspend to implement single thread
 	optimization.  Add LIBC_CANCEL_HANDLED for cancellation marking.
diff --git a/signal/sigrelse.c b/signal/sigrelse.c
index e41c2bd..61f240b 100644
--- a/signal/sigrelse.c
+++ b/signal/sigrelse.c
@@ -26,14 +26,8 @@ sigrelse (int sig)
 {
   sigset_t set;
 
-  /* Retrieve current signal set.  */
-  if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+  sigemptyset (&set);
+  if (sigaddset (&set, sig) < 0)
     return -1;
-
-  /* Remove the specified signal.  */
-  if (sigdelset (&set, sig) < 0)
-    return -1;
-
-  /* Set the new mask.  */
-  return __sigprocmask (SIG_SETMASK, &set, NULL);
+  return __sigprocmask (SIG_UNBLOCK, &set, NULL);
 }

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ad4f43a2344864ae2304060dcc722a7a63bad1b4

commit ad4f43a2344864ae2304060dcc722a7a63bad1b4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Nov 3 10:55:09 2017 -0200

    Cleanup sigpause implementation
    
    This patch simplify sigpause by remobing the single thread optimization
    since it will be handled already by the __sigsuspend call.
    
    Checked on x86_64-linux-gnu.
    
    	* sysdeps/posix/sigpause.c (do_sigpause): Remove.
    	(__sigpause): Rely on __sigsuspend to implement single thread
    	optimization.  Add LIBC_CANCEL_HANDLED for cancellation marking.
    
    Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
    Reviewed-by: Zack Weinberg <zackw@panix.com>

diff --git a/ChangeLog b/ChangeLog
index b63fa4f..6f10dd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-15  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* sysdeps/posix/sigpause.c (do_sigpause): Remove.
+	(__sigpause): Rely on __sigsuspend to implement single thread
+	optimization.  Add LIBC_CANCEL_HANDLED for cancellation marking.
+
 2017-11-15  Joseph Myers  <joseph@codesourcery.com>
 
 	* scripts/build-many-glibcs.py (Context.checkout): Default Linux
diff --git a/sysdeps/posix/sigpause.c b/sysdeps/posix/sigpause.c
index 9038ed3..a61e056 100644
--- a/sysdeps/posix/sigpause.c
+++ b/sysdeps/posix/sigpause.c
@@ -19,15 +19,13 @@
 #include <errno.h>
 #include <signal.h>
 #include <stddef.h>		/* For NULL.  */
-#include <sysdep-cancel.h>
 #undef sigpause
 
 #include <sigset-cvt-mask.h>
+#include <sysdep-cancel.h>
 
-/* Set the mask of blocked signals to MASK,
-   wait for a signal to arrive, and then restore the mask.  */
-static int
-do_sigpause (int sig_or_mask, int is_sig)
+int
+__sigpause (int sig_or_mask, int is_sig)
 {
   sigset_t set;
 
@@ -46,21 +44,6 @@ do_sigpause (int sig_or_mask, int is_sig)
      to do anything here.  */
   return __sigsuspend (&set);
 }
-
-int
-__sigpause (int sig_or_mask, int is_sig)
-{
-  if (SINGLE_THREAD_P)
-    return do_sigpause (sig_or_mask, is_sig);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = do_sigpause (sig_or_mask, is_sig);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 libc_hidden_def (__sigpause)
 
 /* We have to provide a default version of this function since the
@@ -87,3 +70,6 @@ __xpg_sigpause (int sig)
   return __sigpause (sig, 1);
 }
 strong_alias (__xpg_sigpause, __libc___xpg_sigpause)
+
+/* __sigsuspend handles cancellation.  */
+LIBC_CANCEL_HANDLED ();

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    8 ++++++++
 signal/sigrelse.c        |   12 +++---------
 sysdeps/posix/sigpause.c |   26 ++++++--------------------
 3 files changed, 17 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]