2019-07-12 Mike Crowe <mac@mcrowe.com>
+ * nptl/pthread_cond_wait.c: (__pthread_cond_clockwait): Remove code
+ that is only useful if futex_supports_exact_relative_timeouts ()
+ returns false.
+ * nptl/pthread_condattr_setclock.c: (pthread_condattr_setclock):
+ Likewise.
+ * sysdeps/nptl/futex-internal.h: Remove comment about relative
+ timeouts potentially being imprecise since it's no longer true.
+ Remove declaration of futex_supports_exact_relative_timeouts.
+ * sysdeps/unix/sysv/linux/futex-internal.h: Remove implementation
+ of futex_supports_exact_relative_timeouts.
+
* NEWS: Mention recently-added pthread_cond_clockwait,
pthread_rwlock_clockrdlock, pthread_rwlock_clockwrlock and
sem_clockwait functions.
if (!futex_abstimed_supported_clockid (clockid))
return EINVAL;
- /* If we do not support waiting using CLOCK_MONOTONIC, return an error. */
- if (clockid == CLOCK_MONOTONIC
- && !futex_supports_exact_relative_timeouts ())
- return EINVAL;
-
return __pthread_cond_wait_common (cond, mutex, clockid, abstime);
}
weak_alias (__pthread_cond_clockwait, pthread_cond_clockwait);
in the pthread_cond_t structure needs to be adjusted. */
return EINVAL;
- /* If we do not support waiting using CLOCK_MONOTONIC, return an error. */
- if (clock_id == CLOCK_MONOTONIC
- && !futex_supports_exact_relative_timeouts())
- return ENOTSUP;
-
/* Make sure the value fits in the bits we reserved. */
assert (clock_id < (1 << COND_CLOCK_BITS));
Both absolute and relative timeouts can be used. An absolute timeout
expires when the given specific point in time on the specified clock
passes, or when it already has passed. A relative timeout expires when
- the given duration of time on the CLOCK_MONOTONIC clock passes. Relative
- timeouts may be imprecise (see futex_supports_exact_relative_timeouts).
+ the given duration of time on the CLOCK_MONOTONIC clock passes.
Due to POSIX requirements on when synchronization data structures such
as mutexes or semaphores can be destroyed and due to the futex design
static __always_inline int
futex_supports_pshared (int pshared);
-/* Returns true if relative timeouts are robust to concurrent changes to the
- system clock. If this returns false, relative timeouts can still be used
- but might be effectively longer or shorter than requested. */
-static __always_inline bool
-futex_supports_exact_relative_timeouts (void);
-
/* Atomically wrt other futex operations on the same futex, this blocks iff
the value *FUTEX_WORD matches the expected value. This is
semantically equivalent to:
return EINVAL;
}
-/* The Linux kernel supports relative timeouts measured against the
- CLOCK_MONOTONIC clock. */
-static __always_inline bool
-futex_supports_exact_relative_timeouts (void)
-{
- return true;
-}
-
/* See sysdeps/nptl/futex-internal.h for details. */
static __always_inline int
futex_wait (unsigned int *futex_word, unsigned int expected, int private)