aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/base/call_once.h
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-14 03:07:06 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-14 03:07:06 +0000
commit39dbb21d63fcd4848f54cf7dfc7188f7216c36f4 (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/base/call_once.h
parentf60eaea2240ba9e1c508e8e0c91d39ee9fc47be5 (diff)
parent6c9587948173932b64d97c288a947e43d2a2ac14 (diff)
downloadwebrtc-39dbb21d63fcd4848f54cf7dfc7188f7216c36f4.tar.gz
Change-Id: I2cdc23e9d294e3701ac746469aea1ce793eb9ce4
Diffstat (limited to 'third_party/abseil-cpp/absl/base/call_once.h')
-rw-r--r--third_party/abseil-cpp/absl/base/call_once.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/third_party/abseil-cpp/absl/base/call_once.h b/third_party/abseil-cpp/absl/base/call_once.h
index bc5ec93704..96109f537c 100644
--- a/third_party/abseil-cpp/absl/base/call_once.h
+++ b/third_party/abseil-cpp/absl/base/call_once.h
@@ -175,17 +175,10 @@ void CallOnceImpl(std::atomic<uint32_t>* control,
std::memory_order_relaxed) ||
base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans,
scheduling_mode) == kOnceInit) {
- base_internal::Invoke(std::forward<Callable>(fn),
+ base_internal::invoke(std::forward<Callable>(fn),
std::forward<Args>(args)...);
- // The call to SpinLockWake below is an optimization, because the waiter
- // in SpinLockWait is waiting with a short timeout. The atomic load/store
- // sequence is slightly faster than an atomic exchange:
- // old_control = control->exchange(base_internal::kOnceDone,
- // std::memory_order_release);
- // We opt for a slightly faster case when there are no waiters, in spite
- // of longer tail latency when there are waiters.
- old_control = control->load(std::memory_order_relaxed);
- control->store(base_internal::kOnceDone, std::memory_order_release);
+ old_control =
+ control->exchange(base_internal::kOnceDone, std::memory_order_release);
if (old_control == base_internal::kOnceWaiter) {
base_internal::SpinLockWake(control, true);
}