diff options
author | Abseil Team <absl-team@google.com> | 2021-10-08 07:49:05 -0700 |
---|---|---|
committer | rogeeff <rogeeff@google.com> | 2021-10-08 17:03:09 -0400 |
commit | 4a995b1eaa4a602f0d3a9ff8eac89d4649cd2fe8 (patch) | |
tree | f96b0fbc8c2137bcf7478f039e3a1ce094aa9923 /absl | |
parent | 59672bec983cb49050363cb47c261a450603409a (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
Diffstat (limited to 'absl')
-rw-r--r-- | absl/synchronization/mutex_benchmark.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |