summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-10-08 07:49:05 -0700
committerGravatar rogeeff <rogeeff@google.com>2021-10-08 17:03:09 -0400
commit4a995b1eaa4a602f0d3a9ff8eac89d4649cd2fe8 (patch)
treef96b0fbc8c2137bcf7478f039e3a1ce094aa9923
parent59672bec983cb49050363cb47c261a450603409a (diff)
Export of internal Abseil changes
-- 35df3686d19c2864fea8796e109c76e179c3375e by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 401769948 -- fcfe13483862a7c11c0bee789ca8d6f47d31860a by Derek Mauro <dmauro@google.com>: Update Google Benchmark dependency PiperOrigin-RevId: 401528577 GitOrigin-RevId: 35df3686d19c2864fea8796e109c76e179c3375e Change-Id: I7a5123ea37de10e5bde9c9c74faa7e43d80490ca
-rw-r--r--WORKSPACE8
-rw-r--r--absl/synchronization/mutex_benchmark.cc6
2 files changed, 7 insertions, 7 deletions
diff --git a/WORKSPACE b/WORKSPACE
index af307872..84ab3ed4 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -29,10 +29,10 @@ http_archive(
# Google benchmark.
http_archive(
- name = "com_github_google_benchmark", # 2021-07-01T09:02:54Z
- sha256 = "1cb4b97a90aa1fd9c8e412a6bc29fc13fc140162a4a0db3811af40befd8c9ea5",
- strip_prefix = "benchmark-e451e50e9b8af453f076dec10bd6890847f1624e",
- urls = ["https://github.com/google/benchmark/archive/e451e50e9b8af453f076dec10bd6890847f1624e.zip"],
+ name = "com_github_google_benchmark", # 2021-09-20T09:19:51Z
+ sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0",
+ strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
+ urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"],
)
# C++ rules for Bazel.
diff --git a/absl/synchronization/mutex_benchmark.cc b/absl/synchronization/mutex_benchmark.cc
index e35aed8b..b5d2fbc4 100644
--- a/absl/synchronization/mutex_benchmark.cc
+++ b/absl/synchronization/mutex_benchmark.cc
@@ -97,7 +97,7 @@ void BM_MutexEnqueue(benchmark::State& state) {
// Mutex queueing behavior is modified.
const bool multiple_priorities = state.range(0);
ScopedThreadMutexPriority priority_setter(
- (multiple_priorities && state.thread_index != 0) ? 1 : 0);
+ (multiple_priorities && state.thread_index() != 0) ? 1 : 0);
struct Shared {
absl::Mutex mu;
@@ -176,7 +176,7 @@ BENCHMARK(BM_MutexEnqueue)
template <typename MutexType>
void BM_Contended(benchmark::State& state) {
- int priority = state.thread_index % state.range(1);
+ int priority = state.thread_index() % state.range(1);
ScopedThreadMutexPriority priority_setter(priority);
struct Shared {
@@ -196,7 +196,7 @@ void BM_Contended(benchmark::State& state) {
// To achieve this amount of local work is multiplied by number of threads
// to keep ratio between local work and critical section approximately
// equal regardless of number of threads.
- DelayNs(100 * state.threads, &local);
+ DelayNs(100 * state.threads(), &local);
RaiiLocker<MutexType> locker(&shared->mu);
DelayNs(state.range(0), &shared->data);
}