about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/nptl-init.c29
-rw-r--r--nptl/pthread_mutex_timedlock.c27
2 files changed, 0 insertions, 56 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index b5895fabf3..61ec8ed12a 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -58,15 +58,6 @@ int __set_robust_list_avail;
 # define set_robust_list_not_avail() do { } while (0)
 #endif
 
-#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-/* Nonzero if we do not have FUTEX_CLOCK_REALTIME.  */
-int __have_futex_clock_realtime;
-# define __set_futex_clock_realtime() \
-  __have_futex_clock_realtime = 1
-#else
-#define __set_futex_clock_realtime() do { } while (0)
-#endif
-
 /* Version of the library, used in libthread_db to detect mismatches.  */
 static const char nptl_version[] __attribute_used__ = VERSION;
 
@@ -298,26 +289,6 @@ __pthread_initialize_minimal_internal (void)
       set_robust_list_not_avail ();
   }
 
-#ifdef __NR_futex
-# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
-    {
-      int word = 0;
-      /* NB: the syscall actually takes six parameters.  The last is the
-	 bit mask.  But since we will not actually wait at all the value
-	 is irrelevant.  Given that passing six parameters is difficult
-	 on some architectures we just pass whatever random value the
-	 calling convention calls for to the kernel.  It causes no harm.  */
-      INTERNAL_SYSCALL_DECL (err);
-      word = INTERNAL_SYSCALL (futex, err, 5, &word,
-			       FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
-			       | FUTEX_PRIVATE_FLAG, 1, NULL, 0);
-      assert (INTERNAL_SYSCALL_ERROR_P (word, err));
-      if (INTERNAL_SYSCALL_ERRNO (word, err) != ENOSYS)
-	__set_futex_clock_realtime ();
-    }
-# endif
-#endif
-
   /* Set initial thread's stack block from 0 up to __libc_stack_end.
      It will be bigger than it actually is, but for unwind.c/pt-longjmp.c
      purposes this is good enough.  */
diff --git a/nptl/pthread_mutex_timedlock.c b/nptl/pthread_mutex_timedlock.c
index 2f61a7d0d5..270b072c97 100644
--- a/nptl/pthread_mutex_timedlock.c
+++ b/nptl/pthread_mutex_timedlock.c
@@ -240,27 +240,6 @@ __pthread_mutex_timedlock (pthread_mutex_t *mutex,
 	     values despite them being valid.  */
 	  if (__glibc_unlikely (abstime->tv_sec < 0))
 	    return ETIMEDOUT;
-#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
-     || !defined lll_futex_timed_wait_bitset)
-	  struct timeval tv;
-	  struct timespec rt;
-
-	  /* Get the current time.  */
-	  (void) __gettimeofday (&tv, NULL);
-
-	  /* Compute relative timeout.  */
-	  rt.tv_sec = abstime->tv_sec - tv.tv_sec;
-	  rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
-	  if (rt.tv_nsec < 0)
-	    {
-	      rt.tv_nsec += 1000000000;
-	      --rt.tv_sec;
-	    }
-
-	  /* Already timed out?  */
-	  if (rt.tv_sec < 0)
-	    return ETIMEDOUT;
-#endif
 
 	  /* We cannot acquire the mutex nor has its owner died.  Thus, try
 	     to block using futexes.  Set FUTEX_WAITERS if necessary so that
@@ -287,18 +266,12 @@ __pthread_mutex_timedlock (pthread_mutex_t *mutex,
 	  assume_other_futex_waiters |= FUTEX_WAITERS;
 
 	  /* Block using the futex.  */
-#if (!defined __ASSUME_FUTEX_CLOCK_REALTIME \
-     || !defined lll_futex_timed_wait_bitset)
-	  lll_futex_timed_wait (&mutex->__data.__lock, oldval,
-				&rt, PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
-#else
 	  int err = lll_futex_timed_wait_bitset (&mutex->__data.__lock,
 	      oldval, abstime, FUTEX_CLOCK_REALTIME,
 	      PTHREAD_ROBUST_MUTEX_PSHARED (mutex));
 	  /* The futex call timed out.  */
 	  if (err == -ETIMEDOUT)
 	    return -err;
-#endif
 	  /* Reload current lock value.  */
 	  oldval = mutex->__data.__lock;
 	}