diff options
author | Justin King <jcking@google.com> | 2024-01-11 18:51:23 +0000 |
---|---|---|
committer | Pranav Kant <prka@google.com> | 2024-01-12 23:20:06 +0000 |
commit | be3c0fe888d69cdfda53a8065c5f486d01f7096e (patch) | |
tree | 895caa0dfb2d0fa35d613d33022fb82531ca040c /sysdeps/unix | |
parent | 5643a977d0e2cca3877775f27a41df08e98d833a (diff) | |
download | glibc-be3c0fe888d69cdfda53a8065c5f486d01f7096e.zip glibc-be3c0fe888d69cdfda53a8065c5f486d01f7096e.tar.gz glibc-be3c0fe888d69cdfda53a8065c5f486d01f7096e.tar.bz2 |
Optimize pthread_cond_timedwait to avoid unnecessary call to clock_gettime for CLOCK_MONOTONIC
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/futex-internal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/futex-internal.h b/sysdeps/unix/sysv/linux/futex-internal.h index 96a07b0..7ccd40a 100644 --- a/sysdeps/unix/sysv/linux/futex-internal.h +++ b/sysdeps/unix/sysv/linux/futex-internal.h @@ -194,7 +194,7 @@ futex_abstimed_wait (unsigned int *futex_word, unsigned int expected, static __always_inline int futex_abstimed_wait_cancelable (unsigned int *futex_word, unsigned int expected, - const struct timespec *abstime, int private) + const struct timespec *abstime, int clockbit, int private) { /* Work around the fact that the kernel rejects negative timeout values despite them being valid. */ @@ -203,7 +203,7 @@ futex_abstimed_wait_cancelable (unsigned int *futex_word, int oldtype; oldtype = __pthread_enable_asynccancel (); int err = lll_futex_timed_wait_bitset (futex_word, expected, abstime, - FUTEX_CLOCK_REALTIME, private); + clockbit, private); __pthread_disable_asynccancel (oldtype); switch (err) { |