about summary refs log tree commit diff
path: root/nptl/pthreadP.h
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthreadP.h')
-rw-r--r--nptl/pthreadP.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h
index 993a79e250..d08b219b5d 100644
--- a/nptl/pthreadP.h
+++ b/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 */