+2017-08-22 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Replace
+ pause_not_cancel with __pause_nocancel.
+ * sysdeps/generic/not-cancel.h (pause_not_cancel): Remove macro.
+ (__pause_nocancel): New macro.
+ * sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): Remove
+ macro.
+ (__pause_nocancel): New prototype.
+ * sysdeps/unix/sysv/linux/pause.c (__pause_nocancel): New function.
+
2017-08-22 Martin Sebor <msebor@redhat.com>
* include/libc-symbols.h (__ifunc_resolver): Declare resolver
/* Suspend the process until a signal arrives.
This always returns -1 and sets `errno' to EINTR. */
extern int __libc_pause (void);
-/* Not cancelable variant. */
-extern int __pause_nocancel (void) attribute_hidden;
extern int __getlogin_r_loginuid (char *name, size_t namesize)
attribute_hidden;
/* Delay the thread indefinitely. */
while (1)
- pause_not_cancel ();
+ __pause_nocancel ();
}
oldval = mutex->__data.__lock;
(void) __writev (fd, iov, n)
# define __waitpid_nocancel(pid, stat_loc, options) \
__waitpid (pid, stat_loc, options)
-#define pause_not_cancel() \
+#define __pause_nocancel() \
__pause ()
#define nanosleep_not_cancel(requested_time, remaining) \
__nanosleep (requested_time, remaining)
weak_alias (__libc_pause, pause)
LIBC_CANCEL_HANDLED (); /* sigsuspend handles our cancellation. */
-
-#ifndef NO_CANCELLATION
-# include <not-cancel.h>
-
-int
-__pause_nocancel (void)
-{
- sigset_t set;
-
- __sigemptyset (&set);
- __sigprocmask (SIG_BLOCK, NULL, &set);
-
- return sigsuspend_not_cancel (&set);
-}
-#endif
libc_hidden_proto (__waitpid_nocancel)
/* Uncancelable pause. */
-#define pause_not_cancel() \
- ({ sigset_t set; \
- int __rc = INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, \
- _NSIG / 8); \
- if (__rc == 0) \
- __rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8); \
- __rc; \
- })
+__typeof (pause) __pause_nocancel;
+libc_hidden_proto (__pause_nocancel)
/* Uncancelable nanosleep. */
#define nanosleep_not_cancel(requested_time, remaining) \
#include <signal.h>
#include <unistd.h>
#include <sysdep-cancel.h>
+#include <not-cancel.h>
/* Suspend the process until a signal arrives.
This always returns -1 and sets errno to EINTR. */
-
int
__libc_pause (void)
{
#endif
}
weak_alias (__libc_pause, pause)
+
+int
+__pause_nocancel (void)
+{
+#ifdef __NR_pause
+ return INLINE_SYSCALL_CALL (pause);
+#else
+ return INLINE_SYSCALL_CALL (ppoll, NULL, 0, NULL, NULL);
+#endif
+}
+libc_hidden_def (__pause_nocancel)