public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Samuel Thibault <sthibaul@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] hurd: Make nanosleep a cancellation point
Date: Mon, 10 Feb 2020 01:04:00 -0000	[thread overview]
Message-ID: <20200210010416.93355.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7e7182256a104da518018a0b4edfe51689487f42

commit 7e7182256a104da518018a0b4edfe51689487f42
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Feb 9 22:27:56 2020 +0000

    hurd: Make nanosleep a cancellation point

Diff:
---
 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 ae9335c..23ebc15 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)


                 reply	other threads:[~2020-02-10  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200210010416.93355.qmail@sourceware.org \
    --to=sthibaul@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).