aboutsummaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/BUILD.bazel3
-rw-r--r--absl/base/CMakeLists.txt2
-rw-r--r--absl/base/internal/exception_safety_testing.h2
-rw-r--r--absl/base/internal/spinlock.cc2
-rw-r--r--absl/base/internal/spinlock_wait.cc7
5 files changed, 8 insertions, 8 deletions
diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel
index 9b86ce7..44de05e 100644
--- a/absl/base/BUILD.bazel
+++ b/absl/base/BUILD.bazel
@@ -187,7 +187,6 @@ cc_library(
deps = [
":base",
":config",
- ":core_headers",
],
)
@@ -236,7 +235,7 @@ cc_library(
"//absl/memory",
"//absl/meta:type_traits",
"//absl/strings",
- "//absl/types:optional",
+ "//absl/utility",
"@com_google_googletest//:gtest",
],
)
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt
index 3c580d4..d506bc4 100644
--- a/absl/base/CMakeLists.txt
+++ b/absl/base/CMakeLists.txt
@@ -381,7 +381,7 @@ set(EXCEPTION_SAFETY_TESTING_TEST_PUBLIC_LIBRARIES
absl::memory
absl::meta
absl::strings
- absl::optional
+ absl::utility
)
absl_test(
diff --git a/absl/base/internal/exception_safety_testing.h b/absl/base/internal/exception_safety_testing.h
index 0ecc417..d4d41a8 100644
--- a/absl/base/internal/exception_safety_testing.h
+++ b/absl/base/internal/exception_safety_testing.h
@@ -33,7 +33,7 @@
#include "absl/meta/type_traits.h"
#include "absl/strings/string_view.h"
#include "absl/strings/substitute.h"
-#include "absl/types/optional.h"
+#include "absl/utility/utility.h"
namespace testing {
diff --git a/absl/base/internal/spinlock.cc b/absl/base/internal/spinlock.cc
index 1b97efb..cef149e 100644
--- a/absl/base/internal/spinlock.cc
+++ b/absl/base/internal/spinlock.cc
@@ -141,7 +141,7 @@ void SpinLock::SlowLock() {
// owner to think it experienced contention.
if (lockword_.compare_exchange_strong(
lock_value, lock_value | kSpinLockSleeper,
- std::memory_order_acquire, std::memory_order_relaxed)) {
+ std::memory_order_relaxed, std::memory_order_relaxed)) {
// Successfully transitioned to kSpinLockSleeper. Pass
// kSpinLockSleeper to the SpinLockWait routine to properly indicate
// the last lock_value observed.
diff --git a/absl/base/internal/spinlock_wait.cc b/absl/base/internal/spinlock_wait.cc
index 0fde9c0..365a793 100644
--- a/absl/base/internal/spinlock_wait.cc
+++ b/absl/base/internal/spinlock_wait.cc
@@ -38,14 +38,15 @@ namespace base_internal {
uint32_t SpinLockWait(std::atomic<uint32_t> *w, int n,
const SpinLockWaitTransition trans[],
base_internal::SchedulingMode scheduling_mode) {
- for (int loop = 0; ; loop++) {
+ int loop = 0;
+ for (;;) {
uint32_t v = w->load(std::memory_order_acquire);
int i;
for (i = 0; i != n && v != trans[i].from; i++) {
}
if (i == n) {
- SpinLockDelay(w, v, loop, scheduling_mode); // no matching transition
- } else if (trans[i].to == v || // null transition
+ SpinLockDelay(w, v, ++loop, scheduling_mode); // no matching transition
+ } else if (trans[i].to == v || // null transition
w->compare_exchange_strong(v, trans[i].to,
std::memory_order_acquire,
std::memory_order_relaxed)) {