25 #ifndef ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_
26 #define ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_
33 #include "absl/base/internal/raw_logging.h"
34 #include "absl/time/clock.h"
35 #include "absl/time/time.h"
39 namespace synchronization_internal {
99 typedef unsigned long DWord;
100 DWord InMillisecondsFromNow()
const {
114 (std::min<uint64_t>(max_nanos,
ns_ -
now) + 999999
u) / 1000000
u;
115 if (ms_from_now > kInfinite) {
118 return static_cast<DWord
>(ms_from_now);
133 ERROR,
"Tried to create a timespec from a non-timeout; never do this.");
144 struct timespec abstime;
147 abstime.tv_sec =
static_cast<time_t
>(
seconds);
148 abstime.tv_nsec =
static_cast<decltype(abstime.tv_nsec)
>(
n %
kNanosPerSecond);
156 #endif // ABSL_SYNCHRONIZATION_INTERNAL_KERNEL_TIMEOUT_H_