mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
Replace ABSL_INTERNAL_LOG with ABSL_RAW_LOG in ReadMonotonicClockNanos.
This method is in the transitive callgraph of TCMalloc via absl::base_internal::CycleClock::Frequency(). ABSL_RAW_LOG avoids a potential reentrancy/deadlock issue when TCMalloc invokes `Frequency` while holding one of its locks. PiperOrigin-RevId: 903293020 Change-Id: I4c8310fa32c1e12d049296377c5a9bf069ef513b
This commit is contained in:
committed by
Copybara-Service
parent
d4d92a7009
commit
fe307ced1f
@@ -244,8 +244,7 @@ static int64_t ReadMonotonicClockNanos() {
|
||||
int rc = clock_gettime(CLOCK_MONOTONIC, &t);
|
||||
#endif
|
||||
if (rc != 0) {
|
||||
ABSL_INTERNAL_LOG(
|
||||
FATAL, "clock_gettime() failed: (" + std::to_string(errno) + ")");
|
||||
ABSL_RAW_LOG(FATAL, "clock_gettime() failed: (%d)", errno);
|
||||
}
|
||||
return int64_t{t.tv_sec} * 1000000000 + t.tv_nsec;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user