Export of internal Abseil changes

--
2182f6d50e2bcb77858aaab6001ebffdc13bee89 by Derek Mauro <dmauro@google.com>:

Use base_internal::AtomicHook instead of std::atomic for
StatusPayloadPrinter

Imports #661

PiperOrigin-RevId: 306514102

--
6f8047057f4530c17c06ab1737a1937c86402807 by Mark Barolak <mbar@google.com>:

Fix ABSL_RANDOM_RANDEN_COPTS setting on FreeBSD

Import of https://github.com/abseil/abseil-cpp/pull/664

PiperOrigin-RevId: 306485774

--
cb3b73b9607d0009bbcfd7766f4f1fa4fde9c8b9 by Abseil Team <absl-team@google.com>:

Avoid a -Wimplicit-int-float-conversion warning.

Without this explicit cast, this code produces a warning of "implicit conversion from 'const int64_t' (aka 'const long') to 'double' may lose precision" when this warning is turned on.

PiperOrigin-RevId: 306358838

--
ef895ea6b28c96b64531c218705bac9c3fa169d5 by Greg Falcon <gfalcon@google.com>:

Internal change

PiperOrigin-RevId: 306040909
GitOrigin-RevId: 2182f6d50e2bcb77858aaab6001ebffdc13bee89
Change-Id: I69555c1722745a74c1603c62a621ca765d253fe5
pull/665/head
Abseil Team 5 years ago committed by Mark Barolak
parent 2946ac0dea
commit 71079e42cb
  1. 4
      absl/synchronization/internal/mutex_nonprod.cc
  2. 4
      absl/time/time.h

@ -32,6 +32,10 @@
namespace absl { namespace absl {
ABSL_NAMESPACE_BEGIN ABSL_NAMESPACE_BEGIN
void SetMutexDeadlockDetectionMode(OnDeadlockCycle) {}
void EnableMutexInvariantDebugging(bool) {}
namespace synchronization_internal { namespace synchronization_internal {
namespace { namespace {

@ -1348,8 +1348,8 @@ constexpr Duration MakeDuration(int64_t hi, int64_t lo) {
// it's positive and can be converted to int64_t without risk of UB. // it's positive and can be converted to int64_t without risk of UB.
inline Duration MakePosDoubleDuration(double n) { inline Duration MakePosDoubleDuration(double n) {
const int64_t int_secs = static_cast<int64_t>(n); const int64_t int_secs = static_cast<int64_t>(n);
const uint32_t ticks = const uint32_t ticks = static_cast<uint32_t>(
static_cast<uint32_t>((n - int_secs) * kTicksPerSecond + 0.5); (n - static_cast<double>(int_secs)) * kTicksPerSecond + 0.5);
return ticks < kTicksPerSecond return ticks < kTicksPerSecond
? MakeDuration(int_secs, ticks) ? MakeDuration(int_secs, ticks)
: MakeDuration(int_secs + 1, ticks - kTicksPerSecond); : MakeDuration(int_secs + 1, ticks - kTicksPerSecond);

Loading…
Cancel
Save