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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user