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
pull/1038/head
Abseil Team 3 years ago committed by rogeeff
parent 59672bec98
commit 4a995b1eaa
  1. 8
      WORKSPACE
  2. 6
      absl/synchronization/mutex_benchmark.cc

@ -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.

@ -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);
}

Loading…
Cancel
Save