mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
nptl: Replace lll_futex_{timed_}wait by futex-internal.h
The idea is to make NPTL implementation to use on the functions provided by futex-internal.h. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
parent
5289cec4b8
commit
878fe624d4
4 changed files with 14 additions and 12 deletions
|
@ -18,7 +18,7 @@
|
||||||
<https://www.gnu.org/licenses/>. */
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <lowlevellock.h>
|
#include <futex-internal.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#include <stap-probe.h>
|
#include <stap-probe.h>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ __lll_lock_wait_private (int *futex)
|
||||||
{
|
{
|
||||||
futex:
|
futex:
|
||||||
LIBC_PROBE (lll_lock_wait_private, 1, futex);
|
LIBC_PROBE (lll_lock_wait_private, 1, futex);
|
||||||
lll_futex_wait (futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
futex_wait ((unsigned int *) futex, 2, LLL_PRIVATE); /* Wait if *futex == 2. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ __lll_lock_wait (int *futex, int private)
|
||||||
{
|
{
|
||||||
futex:
|
futex:
|
||||||
LIBC_PROBE (lll_lock_wait, 1, futex);
|
LIBC_PROBE (lll_lock_wait, 1, futex);
|
||||||
lll_futex_wait (futex, 2, private); /* Wait if *futex == 2. */
|
futex_wait ((unsigned int *) futex, 2, private); /* Wait if *futex == 2. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -307,7 +307,7 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
||||||
assume_other_futex_waiters |= FUTEX_WAITERS;
|
assume_other_futex_waiters |= FUTEX_WAITERS;
|
||||||
|
|
||||||
/* Block using the futex and reload current lock value. */
|
/* Block using the futex and reload current lock value. */
|
||||||
lll_futex_wait (&mutex->__data.__lock, oldval,
|
futex_wait ((unsigned int *) &mutex->__data.__lock, oldval,
|
||||||
PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
|
PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
|
||||||
oldval = mutex->__data.__lock;
|
oldval = mutex->__data.__lock;
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,8 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (oldval != ceilval)
|
if (oldval != ceilval)
|
||||||
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
|
futex_wait ((unsigned int * ) &mutex->__data.__lock,
|
||||||
|
ceilval | 2,
|
||||||
PTHREAD_MUTEX_PSHARED (mutex));
|
PTHREAD_MUTEX_PSHARED (mutex));
|
||||||
}
|
}
|
||||||
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthreadP.h>
|
#include <pthreadP.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
|
#include <futex-internal.h>
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -84,7 +85,7 @@ pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prioceiling,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (oldval != ceilval)
|
if (oldval != ceilval)
|
||||||
lll_futex_wait (&mutex->__data.__lock, ceilval | 2,
|
futex_wait ((unsigned int *) &mutex->__data.__lock, ceilval | 2,
|
||||||
PTHREAD_MUTEX_PSHARED (mutex));
|
PTHREAD_MUTEX_PSHARED (mutex));
|
||||||
}
|
}
|
||||||
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
|
|
|
@ -561,9 +561,9 @@ __pthread_mutex_clocklock_common (pthread_mutex_t *mutex,
|
||||||
goto failpp;
|
goto failpp;
|
||||||
}
|
}
|
||||||
|
|
||||||
lll_futex_timed_wait (&mutex->__data.__lock,
|
__futex_abstimed_wait64 (
|
||||||
ceilval | 2, &rt,
|
(unsigned int *) &mutex->__data.__lock, clockid,
|
||||||
PTHREAD_MUTEX_PSHARED (mutex));
|
ceilval | 2, &rt, PTHREAD_MUTEX_PSHARED (mutex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
while (atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
|
||||||
|
|
Loading…
Add table
Reference in a new issue