1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

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 <kurt@linutronix.de>
This commit is contained in:
Adhemerval Zanella
2021-06-25 10:11:00 +02:00
parent dd5adb515c
commit 8352b6df37
5 changed files with 72 additions and 56 deletions

View File

@@ -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