diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-10 00:52:50 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-10 01:03:54 +0000 |
commit | e9644c20ce4718ca99953cab0d306b7789303c8e (patch) | |
tree | 89e57ee542ffff864375f9631e4301bbea3991ea /sysdeps/mach/htl/pt-block.c | |
parent | 1cec114b17ad2d5b019074e3cd419cb331feac7a (diff) | |
download | glibc-e9644c20ce4718ca99953cab0d306b7789303c8e.tar.gz glibc-e9644c20ce4718ca99953cab0d306b7789303c8e.tar.xz glibc-e9644c20ce4718ca99953cab0d306b7789303c8e.zip |
htl: Make sem_wait/sem_timedwait interruptible
Diffstat (limited to 'sysdeps/mach/htl/pt-block.c')
-rw-r--r-- | sysdeps/mach/htl/pt-block.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sysdeps/mach/htl/pt-block.c b/sysdeps/mach/htl/pt-block.c index e1500dce33..28bae157d1 100644 --- a/sysdeps/mach/htl/pt-block.c +++ b/sysdeps/mach/htl/pt-block.c @@ -24,15 +24,30 @@ #include <pt-internal.h> +#ifndef MSG_OPTIONS +# define MSG_OPTIONS 0 +#endif + +#ifndef RETTYPE +# define RETTYPE void +#endif + +#ifndef RETURN +# define RETURN(val) +#endif + /* Block THREAD. */ -void +RETTYPE __pthread_block (struct __pthread *thread) { mach_msg_header_t msg; error_t err; - err = __mach_msg (&msg, MACH_RCV_MSG, 0, sizeof msg, + err = __mach_msg (&msg, MACH_RCV_MSG | MSG_OPTIONS, 0, sizeof msg, thread->wakeupmsg.msgh_remote_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); + if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED) + RETURN(EINTR); assert_perror (err); + RETURN(0); } |