[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd,commited 03/10] hurd: Make nanosleep a cancellation point
From: |
Samuel Thibault |
Subject: |
[hurd,commited 03/10] hurd: Make nanosleep a cancellation point |
Date: |
Mon, 10 Feb 2020 02:05:01 +0100 |
---
sysdeps/mach/clock_nanosleep.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sysdeps/mach/clock_nanosleep.c b/sysdeps/mach/clock_nanosleep.c
index ae9335cb2b..23ebc15274 100644
--- a/sysdeps/mach/clock_nanosleep.c
+++ b/sysdeps/mach/clock_nanosleep.c
@@ -22,6 +22,7 @@
#include <unistd.h>
#include <posix-timer.h>
#include <shlib-compat.h>
+#include <sysdep-cancel.h>
static int
nanosleep_call (const struct timespec *req, struct timespec *rem)
@@ -39,9 +40,13 @@ nanosleep_call (const struct timespec *req, struct timespec
*rem)
if (rem != NULL)
__clock_gettime (CLOCK_REALTIME, &before);
+ int cancel_oldtype = LIBC_CANCEL_ASYNC();
err = __mach_msg (NULL, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT,
0, 0, recv, ms, MACH_PORT_NULL);
+ LIBC_CANCEL_RESET (cancel_oldtype);
+
__mach_port_destroy (mach_task_self (), recv);
+
if (err == EMACH_RCV_INTERRUPTED)
{
if (rem != NULL)
--
2.24.1
- [hurd, commited 01/10] htl: clean __pthread_get_cleanup_stack hidden proto, Samuel Thibault, 2020/02/09
- [hurd,commited 06/10] htl: Make sem_open return ENOSYS, Samuel Thibault, 2020/02/09
- [hurd, commited 04/10] pthread: Move key tests from nptl to sysdeps/pthread, Samuel Thibault, 2020/02/09
- [hurd,commited 05/10] htl: Add support for semaphore maximum value, Samuel Thibault, 2020/02/09
- [hurd,commited 03/10] hurd: Make nanosleep a cancellation point,
Samuel Thibault <=
- [hurd, commited 08/10] pthread: Move most sem tests from nptl to sysdeps/pthread, Samuel Thibault, 2020/02/09
- [hurd,commited 02/10] htl: Add support for libc cancellation points, Samuel Thibault, 2020/02/09
- [hurd,commited 09/10] htl: Fix barrier_wait with one thread, Samuel Thibault, 2020/02/09
- [hurd, commited 10/10] pthread: Move most barrier tests from nptl to sysdeps/pthread, Samuel Thibault, 2020/02/09
- [hurd,commited 07/10] htl: Make sem_wait/sem_timedwait interruptible, Samuel Thibault, 2020/02/09