aboutsummaryrefslogtreecommitdiff
path: root/absl/synchronization/BUILD.bazel
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2023-02-09 19:45:05 -0800
committerCopybara-Service <copybara-worker@google.com>2023-02-09 19:45:48 -0800
commitfa4855403cdfb91b9c16f792041258ed819594c1 (patch)
tree49546e9be6ce6fafbc78e4120b8ad51de386fdf3 /absl/synchronization/BUILD.bazel
parent823b837839db2a754af37095c72f97ce6733d32b (diff)
downloadabseil-fa4855403cdfb91b9c16f792041258ed819594c1.tar.gz
abseil-fa4855403cdfb91b9c16f792041258ed819594c1.tar.bz2
abseil-fa4855403cdfb91b9c16f792041258ed819594c1.zip
Rewrite KernelTimeout to support both absolute and relative timeouts
APIs that take KernelTimeout as a parameter can now query if an absolute or relative timeout was requested. If the underlying API can only use one type of timeout, the code will do a reasonable conversion. The goal is to eventually enable the possibility of using wait times that are based on monotonic clocks that are safe against system clock steps. PiperOrigin-RevId: 508541507 Change-Id: Id08bf13515f3e1bfd78d88393cde98a6fd3ef72c
Diffstat (limited to 'absl/synchronization/BUILD.bazel')
-rw-r--r--absl/synchronization/BUILD.bazel16
1 files changed, 15 insertions, 1 deletions
diff --git a/absl/synchronization/BUILD.bazel b/absl/synchronization/BUILD.bazel
index ccaee796..9c89ac49 100644
--- a/absl/synchronization/BUILD.bazel
+++ b/absl/synchronization/BUILD.bazel
@@ -53,6 +53,7 @@ cc_library(
cc_library(
name = "kernel_timeout_internal",
+ srcs = ["internal/kernel_timeout.cc"],
hdrs = ["internal/kernel_timeout.h"],
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
@@ -60,12 +61,25 @@ cc_library(
"//absl/synchronization:__pkg__",
],
deps = [
- "//absl/base:core_headers",
+ "//absl/base:config",
"//absl/base:raw_logging_internal",
"//absl/time",
],
)
+cc_test(
+ name = "kernel_timeout_internal_test",
+ srcs = ["internal/kernel_timeout_test.cc"],
+ copts = ABSL_TEST_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ deps = [
+ ":kernel_timeout_internal",
+ "//absl/base:config",
+ "//absl/time",
+ "@com_google_googletest//:gtest_main",
+ ],
+)
+
cc_library(
name = "synchronization",
srcs = [