* [hurd,commited] hurd: Document how EINTR should be handled in critical sections
@ 2019-03-16 18:43 Samuel Thibault
0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2019-03-16 18:43 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault, commit-hurd
* hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR
should be handled.
---
ChangeLog | 5 +++++
hurd/hurd/signal.h | 8 +++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 3d2bdc8143..ce14d885b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-16 Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+ * hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR
+ should be handled.
+
2019-03-15 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/syscall-names.list: Update kernel
diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h
index c30f536436..b0b53668d2 100644
--- a/hurd/hurd/signal.h
+++ b/hurd/hurd/signal.h
@@ -168,7 +168,13 @@ extern int _hurd_core_limit;
A critical section is a section of code which cannot safely be interrupted
to run a signal handler; for example, code that holds any lock cannot be
interrupted lest the signal handler try to take the same lock and
- deadlock result. */
+ deadlock result.
+
+ As a consequence, a critical section will see its RPCs return EINTR, even if
+ SA_RESTART is set! In that case, the critical section should be left, so
+ that the handler can run, and the whole critical section be tried again, to
+ avoid unexpectingly exposing EINTR to the application.
+ */
extern void *_hurd_critical_section_lock (void);
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-03-16 18:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-16 18:43 [hurd,commited] hurd: Document how EINTR should be handled in critical sections Samuel Thibault
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).