diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
commit | b61be8e632d1cafa8afb229ea0a5b6117ca7125b (patch) | |
tree | 96a36f21d4064f32d1912cbc85e4135788ff70b3 /contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h | |
parent | 7ce58bf82abf75fdc15c2e6fa3aceadcfecfdca1 (diff) | |
download | ydb-b61be8e632d1cafa8afb229ea0a5b6117ca7125b.tar.gz |
intermediate changes
ref:c67faec740b4d59ed47c6dfdc7076c904650af60
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h')
-rw-r--r-- | contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h index 5d80e4e7ca..93239f29e4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h @@ -22,8 +22,8 @@ // fix, so that (for example) non-const references may be passed to the invoked // function. -#ifndef ABSL_BASE_CALL_ONCE_H_ -#define ABSL_BASE_CALL_ONCE_H_ +#ifndef Y_ABSL_BASE_CALL_ONCE_H_ +#define Y_ABSL_BASE_CALL_ONCE_H_ #include <algorithm> #include <atomic> @@ -41,7 +41,7 @@ #include "y_absl/base/port.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN class once_flag; @@ -143,7 +143,7 @@ enum { }; template <typename Callable, typename... Args> -ABSL_ATTRIBUTE_NOINLINE +Y_ABSL_ATTRIBUTE_NOINLINE void CallOnceImpl(std::atomic<uint32_t>* control, base_internal::SchedulingMode scheduling_mode, Callable&& fn, Args&&... args) { @@ -154,7 +154,7 @@ void CallOnceImpl(std::atomic<uint32_t>* control, old_control != kOnceRunning && old_control != kOnceWaiter && old_control != kOnceDone) { - ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx", + Y_ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx", static_cast<unsigned long>(old_control)); // NOLINT } } @@ -173,7 +173,7 @@ void CallOnceImpl(std::atomic<uint32_t>* control, uint32_t old_control = kOnceInit; if (control->compare_exchange_strong(old_control, kOnceRunning, std::memory_order_relaxed) || - base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans, + base_internal::SpinLockWait(control, Y_ABSL_ARRAYSIZE(trans), trans, scheduling_mode) == kOnceInit) { base_internal::invoke(std::forward<Callable>(fn), std::forward<Args>(args)...); @@ -193,7 +193,7 @@ template <typename Callable, typename... Args> void LowLevelCallOnce(y_absl::once_flag* flag, Callable&& fn, Args&&... args) { std::atomic<uint32_t>* once = base_internal::ControlWord(flag); uint32_t s = once->load(std::memory_order_acquire); - if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + if (Y_ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { base_internal::CallOnceImpl(once, base_internal::SCHEDULE_KERNEL_ONLY, std::forward<Callable>(fn), std::forward<Args>(args)...); @@ -206,14 +206,14 @@ template <typename Callable, typename... Args> void call_once(y_absl::once_flag& flag, Callable&& fn, Args&&... args) { std::atomic<uint32_t>* once = base_internal::ControlWord(&flag); uint32_t s = once->load(std::memory_order_acquire); - if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + if (Y_ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { base_internal::CallOnceImpl( once, base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL, std::forward<Callable>(fn), std::forward<Args>(args)...); } } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_CALL_ONCE_H_ +#endif // Y_ABSL_BASE_CALL_ONCE_H_ |