diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-03-23 22:38:54 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-03-23 22:40:10 +0000 |
commit | c3b287be74e12bdb15ed36e98d24fd42f8ee9122 (patch) | |
tree | 82a9f85685a35bf5b12e480ee6ed1abc24103dc8 /hurd/hurd | |
parent | a4ea18ec6cc3f1370efab09bc18c1badbf74aa13 (diff) | |
download | glibc-c3b287be74e12bdb15ed36e98d24fd42f8ee9122.tar.gz glibc-c3b287be74e12bdb15ed36e98d24fd42f8ee9122.tar.xz glibc-c3b287be74e12bdb15ed36e98d24fd42f8ee9122.zip |
hurd: handle EINTR during critical sections
During critical sections, signal handling is deferred and thus RPCs return EINTR, even if SA_RESTART is set. We thus have to restart the whole critical section in that case. This also adds HURD_CRITICAL_UNLOCK in the cases where one wants to break the section in the middle.
Diffstat (limited to 'hurd/hurd')
-rw-r--r-- | hurd/hurd/signal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h index 37b7dec5a0..db9a02f000 100644 --- a/hurd/hurd/signal.h +++ b/hurd/hurd/signal.h @@ -277,6 +277,10 @@ _hurd_critical_section_unlock (void *our_lock) { void *__hurd_critical__ = _hurd_critical_section_lock () #define HURD_CRITICAL_END \ _hurd_critical_section_unlock (__hurd_critical__); } while (0) + +/* This one can be used inside the C scoping level, for early exits. */ +#define HURD_CRITICAL_UNLOCK \ + _hurd_critical_section_unlock (__hurd_critical__); /* Initialize the signal code, and start the signal thread. Arguments give the "init ints" from exec_startup. */ |