File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,7 @@ cc_library(
7272 "//absl/base:core_headers" ,
7373 "//absl/base:raw_logging_internal" ,
7474 "//absl/time" ,
75- ] + select ({
76- "//conditions:default" : [],
77- }),
75+ ],
7876)
7977
8078cc_test (
Original file line number Diff line number Diff line change @@ -129,8 +129,8 @@ class KernelTimeout {
129129 std::chrono::nanoseconds ToChronoDuration () const ;
130130
131131 // Returns true if steady (aka monotonic) clocks are supported by the system.
132- // This method exists because go/btm requires synchronized clocks, and
133- // thus requires we use the system (aka walltime) clock.
132+ // This currently returns true on all platforms, but we have encountered
133+ // platforms that once lacked steady clock support .
134134 static constexpr bool SupportsSteadyClock () { return true ; }
135135
136136 private:
Original file line number Diff line number Diff line change 2424#include " absl/time/time.h"
2525#include " gtest/gtest.h"
2626
27- // Test go/btm support by randomizing the value of clock_gettime() for
28- // CLOCK_MONOTONIC. This works by overriding a weak symbol in glibc.
27+ #if 0 // All supported platforms currently have steady clocks.
28+ #define ABSL_INTERNAL_KERNEL_TIMEOUT_SUPPORTS_STEADY_CLOCK 0
29+ #else
30+ #define ABSL_INTERNAL_KERNEL_TIMEOUT_SUPPORTS_STEADY_CLOCK 1
31+ #endif
32+
33+ static_assert (
34+ absl::synchronization_internal::KernelTimeout::SupportsSteadyClock () ==
35+ static_cast<bool>(ABSL_INTERNAL_KERNEL_TIMEOUT_SUPPORTS_STEADY_CLOCK));
36+
37+ // Randomizing the value of clock_gettime() for CLOCK_MONOTONIC.
38+ // This works by overriding a weak symbol in glibc.
2939// We should be resistant to this randomization when !SupportsSteadyClock().
30- #if defined(__GOOGLE_GRTE_VERSION__) && \
31- !defined (ABSL_HAVE_ADDRESS_SANITIZER) && \
32- !defined (ABSL_HAVE_MEMORY_SANITIZER) && \
40+ #if !ABSL_INTERNAL_KERNEL_TIMEOUT_SUPPORTS_STEADY_CLOCK && \
41+ !defined (ABSL_HAVE_ADDRESS_SANITIZER) && \
42+ !defined (ABSL_HAVE_MEMORY_SANITIZER) && \
3343 !defined (ABSL_HAVE_THREAD_SANITIZER)
3444extern " C" int __clock_gettime (clockid_t c, struct timespec * ts);
3545
You can’t perform that action at this time.
0 commit comments