summaryrefslogtreecommitdiff
path: root/libc/nptl/pthreadP.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/nptl/pthreadP.h')
-rw-r--r--libc/nptl/pthreadP.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libc/nptl/pthreadP.h b/libc/nptl/pthreadP.h
index 993a79e25..d08b219b5 100644
--- a/libc/nptl/pthreadP.h
+++ b/libc/nptl/pthreadP.h
@@ -577,4 +577,16 @@ extern void __wait_lookup_done (void) attribute_hidden;
# define PTHREAD_STATIC_FN_REQUIRE(name) __asm (".globl " #name);
#endif
+/* Test if the mutex is suitable for the FUTEX_WAIT_REQUEUE_PI operation. */
+#if (defined lll_futex_wait_requeue_pi \
+ && defined __ASSUME_REQUEUE_PI)
+# define USE_REQUEUE_PI(mut) \
+ ((mut) && (mut) != (void *) ~0l \
+ && (((mut)->__data.__kind \
+ & (PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NORMAL_NP)) \
+ == PTHREAD_MUTEX_PRIO_INHERIT_NP))
+#else
+# define USE_REQUEUE_PI(mut) 0
+#endif
+
#endif /* pthreadP.h */