From 59bb023c8361c0e12e8eee1810897c5e3ea223b3 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 13 Dec 2020 11:01:52 +0000 Subject: hurd: Add __lll_abstimed_wait_intr For semaphores, we need an interruptible version of low-level locks. --- mach/lowlevellock.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mach') diff --git a/mach/lowlevellock.h b/mach/lowlevellock.h index 0a22a03..b872d0f 100644 --- a/mach/lowlevellock.h +++ b/mach/lowlevellock.h @@ -34,6 +34,17 @@ /* Static initializer for low-level locks. */ #define LLL_LOCK_INITIALIZER 0 +/* Interruptible version of __gsync_wait. */ +extern kern_return_t __gsync_wait_intr +( + mach_port_t task, + vm_offset_t addr, + unsigned val1, + unsigned val2, + natural_t msec, + int flags +); + /* Wait on address PTR, without blocking if its contents * are different from VAL. */ #define __lll_wait(ptr, val, flags) \ @@ -42,6 +53,13 @@ #define lll_wait(var, val, flags) \ __lll_wait (&(var), val, flags) +/* Interruptible version. */ +#define __lll_wait_intr(ptr, val, flags) \ + __gsync_wait_intr (__mach_task_self (), \ + (vm_offset_t)(ptr), (val), 0, 0, (flags)) +#define lll_wait_intr(var, val, flags) \ + __lll_wait_intr ((&var), val, flags) + /* Wake one or more threads waiting on address PTR. */ #define __lll_wake(ptr, flags) \ __gsync_wake (__mach_task_self (), (vm_offset_t)(ptr), 0, (flags)) -- cgit v1.1