about summary refs log tree commit diff
path: root/nptl/pthread_cond_wait.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-11-23 15:26:42 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-11-25 08:14:50 -0300
commit2e39f65b5ef11647beb4980c4244bac8af192c14 (patch)
tree2c01394ff73419ce9119e6aea0091cf2ac13fdd2 /nptl/pthread_cond_wait.c
parent7e9afa8a84a1f86937f2ae362288568c1e0133fb (diff)
downloadglibc-2e39f65b5ef11647beb4980c4244bac8af192c14.tar.gz
glibc-2e39f65b5ef11647beb4980c4244bac8af192c14.tar.xz
glibc-2e39f65b5ef11647beb4980c4244bac8af192c14.zip
nptl: Remove futex_wait_cancelable
It is used solely on __pthread_cond_wait_common and the call can be
replaced by a __futex_abstimed_wait_cancelable64 one.

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

Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'nptl/pthread_cond_wait.c')
-rw-r--r--nptl/pthread_cond_wait.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c
index 7d158d553f..685dbca32f 100644
--- a/nptl/pthread_cond_wait.c
+++ b/nptl/pthread_cond_wait.c
@@ -501,26 +501,8 @@ __pthread_cond_wait_common (pthread_cond_t *cond, pthread_mutex_t *mutex,
 	  cbuffer.private = private;
 	  __pthread_cleanup_push (&buffer, __condvar_cleanup_waiting, &cbuffer);
 
-	  if (abstime == NULL)
-	    {
-	      /* Block without a timeout.  */
-	      err = futex_wait_cancelable (
-		  cond->__data.__g_signals + g, 0, private);
-	    }
-	  else
-	    {
-	      /* Block, but with a timeout.
-		 Work around the fact that the kernel rejects negative timeout
-		 values despite them being valid.  */
-	      if (__glibc_unlikely (abstime->tv_sec < 0))
-	        err = ETIMEDOUT;
-	      else
-		{
-		  err = __futex_abstimed_wait_cancelable64
-                    (cond->__data.__g_signals + g, 0, clockid, abstime,
-                     private);
-		}
-	    }
+	  err = __futex_abstimed_wait_cancelable64 (
+	    cond->__data.__g_signals + g, 0, clockid, abstime, private);
 
 	  __pthread_cleanup_pop (&buffer, 0);