aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2006-07-31 05:58:51 +0000
committerRoland McGrath <roland@gnu.org>2006-07-31 05:58:51 +0000
commitb894c2ea7e9dbf9d777555a2e1a917f5abcbb550 (patch)
tree2329d7803837f09fe25bd3471fa38dc86568598c /nptl
parentb32e6700d0a114c0132bd94cc1b49332a364dc8c (diff)
downloadglibc-b894c2ea7e9dbf9d777555a2e1a917f5abcbb550.tar
glibc-b894c2ea7e9dbf9d777555a2e1a917f5abcbb550.tar.gz
glibc-b894c2ea7e9dbf9d777555a2e1a917f5abcbb550.tar.bz2
glibc-b894c2ea7e9dbf9d777555a2e1a917f5abcbb550.zip
* sysdeps/unix/sysv/linux/ia64/sigsuspend.c: File removed.cvs/fedora-glibc-20060731T0706
* sysdeps/unix/sysv/linux/x86_64/sigsuspend.c: File removed. * sysdeps/unix/sysv/linux/s390/s390-64/sigsuspend.c: File removed. * sysdeps/unix/sysv/linux/sparc/sparc64/sigsuspend.c: File removed. * sysdeps/unix/sysv/linux/not-cancel.h (pause_not_cancel): New macro. (nanosleep_not_cancel): New macro. (sigsuspend_not_cancel): new macro. * sysdeps/unix/sysv/linux/sigsuspend.c [__ASSUME_REALTIME_SIGNALS] (do_sigsuspend): Define as inline. (__sigsuspend): Always use do_sigsuspend. [! NO_CANCELLATION] (__sigsuspend_nocancel): New function. * include/signal.h: Declare __sigsuspend_nocancel. * sysdeps/posix/pause.c [! NO_CANCELLATION] (__pause_nocancel): New function. * include/unistd.h (__pause_nocancel): Add attribute_hidden. * include/time.h (__nanosleep_nocancel): Likewise.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog13
-rw-r--r--nptl/Makefile2
-rw-r--r--nptl/pthread_mutex_lock.c3
-rw-r--r--nptl/pthread_mutex_timedlock.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h12
5 files changed, 31 insertions, 3 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 46a7f33345..0ee39eddc3 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,16 @@
+2006-07-30 Roland McGrath <roland@redhat.com>
+
+ * Makefile (libpthread-routines): Add ptw-sigsuspend.
+
+ * sysdeps/unix/sysv/linux/i386/not-cancel.h
+ (pause_not_cancel): New macro.
+ (nanosleep_not_cancel): New macro.
+ (sigsuspend_not_cancel): New macro.
+ * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Use
+ nanosleep_not_cancel macro from <not-cancel.h>.
+ * pthread_mutex_lock.c (__pthread_mutex_lock): Use pause_not_cancel
+ macro from <not-cancel.h>.
+
2006-07-28 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
diff --git a/nptl/Makefile b/nptl/Makefile
index a4c6174c42..4023e46199 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -108,7 +108,7 @@ libpthread-routines = init vars events version \
ptw-msync ptw-nanosleep ptw-open ptw-open64 ptw-pause \
ptw-pread ptw-pread64 ptw-pwrite ptw-pwrite64 \
ptw-tcdrain ptw-wait ptw-waitpid ptw-msgrcv ptw-msgsnd \
- ptw-sigwait \
+ ptw-sigwait ptw-sigsuspend \
pt-raise pt-system \
flockfile ftrylockfile funlockfile \
sigaction \
diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c
index 5345766883..a19c907695 100644
--- a/nptl/pthread_mutex_lock.c
+++ b/nptl/pthread_mutex_lock.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
+#include <not-cancel.h>
#include "pthreadP.h"
#include <lowlevellock.h>
@@ -278,7 +279,7 @@ __pthread_mutex_lock (mutex)
/* Delay the thread indefinitely. */
while (1)
- __pause_nocancel ();
+ pause_not_cancel ();
}
oldval = mutex->__data.__lock;
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index 12f6c997bb..dcff4f81a8 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -19,8 +19,10 @@
#include <assert.h>
#include <errno.h>
+#include <time.h>
#include "pthreadP.h"
#include <lowlevellock.h>
+#include <not-cancel.h>
int
@@ -281,7 +283,7 @@ pthread_mutex_timedlock (mutex, abstime)
--reltime.tv_sec;
}
if (reltime.tv_sec >= 0)
- while (__nanosleep_nocancel (&reltime, &reltime) != 0)
+ while (nanosleep_not_cancel (&reltime, &reltime) != 0)
continue;
return ETIMEDOUT;
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h b/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h
index 91584948ae..6557359b43 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h
@@ -91,3 +91,15 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag,
# define waitpid_not_cancel(pid, stat_loc, options) \
INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
#endif
+
+/* Uncancelable pause. */
+#define pause_not_cancel() \
+ __pause_nocancel ()
+
+/* Uncancelable nanosleep. */
+#define nanosleep_not_cancel(requested_time, remaining) \
+ __nanosleep_nocancel (requested_time, remaining)
+
+/* Uncancelable sigsuspend. */
+#define sigsuspend_not_cancel(set) \
+ __sigsuspend_nocancel (set)