From 8352b6df371f1d08f86b4600a7725a5181e021ee Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 25 Jun 2021 10:11:00 +0200 Subject: nptl: Use FUTEX_LOCK_PI2 when available This patch uses the new futex PI operation provided by Linux v5.14 when it is required. The futex_lock_pi64() is moved to futex-internal.c (since it used on two different places and its code size might be large depending of the kernel configuration) and clockid is added as an argument. Co-authored-by: Kurt Kanzenbach --- nptl/pthread_mutex_lock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nptl/pthread_mutex_lock.c') diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index fbe8a3cd21..2bd41767e0 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -421,7 +421,8 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex) int private = (robust ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex) : PTHREAD_MUTEX_PSHARED (mutex)); - int e = futex_lock_pi64 (&mutex->__data.__lock, NULL, private); + int e = __futex_lock_pi64 (&mutex->__data.__lock, 0 /* ununsed */, + NULL, private); if (e == ESRCH || e == EDEADLK) { assert (e != EDEADLK -- cgit 1.4.1