about summary refs log tree commit diff
path: root/hurd/hurdlock.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-13 11:01:52 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-12-16 01:58:33 +0100
commit59bb023c8361c0e12e8eee1810897c5e3ea223b3 (patch)
tree1b0ac0698b6f01aa8c69d0960f9bc1f49ec62f03 /hurd/hurdlock.h
parentbec412424e949c900b01767ce32b6743bdaaac93 (diff)
downloadglibc-59bb023c8361c0e12e8eee1810897c5e3ea223b3.tar.gz
glibc-59bb023c8361c0e12e8eee1810897c5e3ea223b3.tar.xz
glibc-59bb023c8361c0e12e8eee1810897c5e3ea223b3.zip
hurd: Add __lll_abstimed_wait_intr
For semaphores, we need an interruptible version of low-level locks.
Diffstat (limited to 'hurd/hurdlock.h')
-rw-r--r--hurd/hurdlock.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/hurd/hurdlock.h b/hurd/hurdlock.h
index c1df42bea4..0a7f6eaf90 100644
--- a/hurd/hurdlock.h
+++ b/hurd/hurdlock.h
@@ -40,6 +40,11 @@ struct timespec;
   __gsync_wait (__mach_task_self (), \
     (vm_offset_t)ptr, val, 0, mlsec, flags | GSYNC_TIMED)
 
+/* Interruptible version.  */
+#define __lll_timed_wait_intr(ptr, val, mlsec, flags) \
+  __gsync_wait_intr (__mach_task_self (), \
+    (vm_offset_t)ptr, val, 0, mlsec, flags | GSYNC_TIMED)
+
 /* Same as '__lll_xwait', but only block for MLSEC milliseconds.  */
 #define __lll_timed_xwait(ptr, lo, hi, mlsec, flags) \
   __gsync_wait (__mach_task_self (), (vm_offset_t)ptr, \
@@ -50,6 +55,10 @@ struct timespec;
 extern int __lll_abstimed_wait (void *__ptr, int __val,
   const struct timespec *__tsp, int __flags, int __clk);
 
+/* Interruptible version.  */
+extern int __lll_abstimed_wait_intr (void *__ptr, int __val,
+  const struct timespec *__tsp, int __flags, int __clk);
+
 /* Same as 'lll_xwait', but only block until TSP elapses,
    using clock CLK.  */
 extern int __lll_abstimed_xwait (void *__ptr, int __lo, int __hi,
@@ -106,6 +115,13 @@ extern void __lll_robust_unlock (void *__ptr, int __flags);
        __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
    })
 
+#define lll_abstimed_wait_intr(var, val, tsp, flags, ...)   \
+  ({   \
+     const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \
+     __lll_abstimed_wait_intr (&(var), (val), (tsp), (flags),   \
+       __clk[sizeof (__clk) / sizeof (__clk[0]) - 1]);   \
+   })
+
 #define lll_abstimed_xwait(var, lo, hi, tsp, flags, ...)   \
   ({   \
      const clockid_t __clk[] = { CLOCK_REALTIME, ##__VA_ARGS__ };   \