about summary refs log tree commit diff
path: root/sysdeps/nptl/futex-internal.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-11-20 10:58:51 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-11-25 10:43:17 -0300
commite77221a523bc07abb4a0141543f6d52e705bd831 (patch)
tree1ad0ad7316985b2d36e931c724df2ad61c8cf8d3 /sysdeps/nptl/futex-internal.c
parent9e92278ffad441daf588ff1ff5bd8094aa33fbfd (diff)
downloadglibc-e77221a523bc07abb4a0141543f6d52e705bd831.tar.gz
glibc-e77221a523bc07abb4a0141543f6d52e705bd831.tar.xz
glibc-e77221a523bc07abb4a0141543f6d52e705bd831.zip
nptl: Extend __futex_abstimed_wait_cancelable64 comment
And add a small optimization to avoid setting the operation for the
32-bit time fallback operation.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'sysdeps/nptl/futex-internal.c')
-rw-r--r--sysdeps/nptl/futex-internal.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sysdeps/nptl/futex-internal.c b/sysdeps/nptl/futex-internal.c
index 457cd3cd69..e4a14b477c 100644
--- a/sysdeps/nptl/futex-internal.c
+++ b/sysdeps/nptl/futex-internal.c
@@ -25,7 +25,7 @@
 #ifndef __ASSUME_TIME64_SYSCALLS
 static int
 __futex_abstimed_wait_cancelable32 (unsigned int* futex_word,
-                                    unsigned int expected, clockid_t clockid,
+                                    unsigned int expected, int op,
                                     const struct __timespec64* abstime,
                                     int private)
 {
@@ -39,10 +39,6 @@ __futex_abstimed_wait_cancelable32 (unsigned int* futex_word,
       pts32 = &ts32;
     }
 
-  unsigned int clockbit = (clockid == CLOCK_REALTIME)
-	  ? FUTEX_CLOCK_REALTIME : 0;
-  int op = __lll_private_flag (FUTEX_WAIT_BITSET | clockbit, private);
-
   return INTERNAL_SYSCALL_CANCEL (futex, futex_word, op, expected,
                                   pts32, NULL /* Unused.  */,
                                   FUTEX_BITSET_MATCH_ANY);
@@ -119,7 +115,7 @@ __futex_abstimed_wait_cancelable64 (unsigned int* futex_word,
 #ifndef __ASSUME_TIME64_SYSCALLS
   if (err == -ENOSYS)
     err = __futex_abstimed_wait_cancelable32 (futex_word, expected,
-                                              clockid, abstime, private);
+                                              op, abstime, private);
 #endif
 
   switch (err)