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-28 16:01:35 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-04-28 16:01:35 +0000
commitcb9e498a892c889c147f7a01b3a40d0df2809daf (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/base/call_once.h
parent67fba77258cd9aaaf0d6a8088610f083520c71a9 (diff)
parent7563023510bf04108a954596ea9393a4c11ac279 (diff)
downloadwebrtc-cb9e498a892c889c147f7a01b3a40d0df2809daf.tar.gz
Snap for 8512216 from 7563023510bf04108a954596ea9393a4c11ac279 to tm-frc-os-statsd-releaset_frc_sta_330443010android13-frc-os-statsd-release
Change-Id: I1fcd170f1eef07ed28e1e7c99aec58269ea849c0
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);
}