userspace-rcu/fix-compat_futex_noasync-on-Cygwin.patch
2019-09-30 11:19:12 -04:00

49 lines
1.6 KiB
Diff

From b197ce865b0de8c475f3ddeadeae3a66b15ace21 Mon Sep 17 00:00:00 2001
From: Michael Jeanson <mjeanson@efficios.com>
Date: Fri, 23 Nov 2018 15:27:04 -0500
Subject: [PATCH 01/15] Fix: compat_futex_noasync on Cygwin
The futex_noasync compat code uses a weak symbol to share state across
different shared object which is not possible on Windows with the
Portable Executable format. Use the async compat code for both cases.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
include/urcu/futex.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/urcu/futex.h b/include/urcu/futex.h
index 0486ff6..753df62 100644
--- a/include/urcu/futex.h
+++ b/include/urcu/futex.h
@@ -102,6 +102,25 @@ static inline int futex_async(int32_t *uaddr, int op, int32_t val,
return ret;
}
+#elif defined(__CYGWIN__)
+
+/*
+ * The futex_noasync compat code uses a weak symbol to share state across
+ * different shared object which is not possible on Windows with the
+ * Portable Executable format. Use the async compat code for both cases.
+ */
+static inline int futex_noasync(int32_t *uaddr, int op, int32_t val,
+ const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
+{
+ return compat_futex_async(uaddr, op, val, timeout, uaddr2, val3);
+}
+
+static inline int futex_async(int32_t *uaddr, int op, int32_t val,
+ const struct timespec *timeout, int32_t *uaddr2, int32_t val3)
+{
+ return compat_futex_async(uaddr, op, val, timeout, uaddr2, val3);
+}
+
#else
static inline int futex_noasync(int32_t *uaddr, int op, int32_t val,
--
2.19.1