mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
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>
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
2017-11-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
2017-11-15 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||||
|
|
||||||
|
* signal/sigrelse.c (sigrelse): Optimize implementation.
|
||||||
|
|
||||||
* sysdeps/posix/sigpause.c (do_sigpause): Remove.
|
* sysdeps/posix/sigpause.c (do_sigpause): Remove.
|
||||||
(__sigpause): Rely on __sigsuspend to implement single thread
|
(__sigpause): Rely on __sigsuspend to implement single thread
|
||||||
optimization. Add LIBC_CANCEL_HANDLED for cancellation marking.
|
optimization. Add LIBC_CANCEL_HANDLED for cancellation marking.
|
||||||
|
@@ -26,14 +26,8 @@ sigrelse (int sig)
|
|||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
/* Retrieve current signal set. */
|
sigemptyset (&set);
|
||||||
if (__sigprocmask (SIG_SETMASK, NULL, &set) < 0)
|
if (sigaddset (&set, sig) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
return __sigprocmask (SIG_UNBLOCK, &set, NULL);
|
||||||
/* Remove the specified signal. */
|
|
||||||
if (sigdelset (&set, sig) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* Set the new mask. */
|
|
||||||
return __sigprocmask (SIG_SETMASK, &set, NULL);
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user