diff --git a/rtc_base/synchronization/mutex_benchmark.cc b/rtc_base/synchronization/mutex_benchmark.cc index 40adca65d8..ae0e3c38e7 100644 --- a/rtc_base/synchronization/mutex_benchmark.cc +++ b/rtc_base/synchronization/mutex_benchmark.cc @@ -38,7 +38,8 @@ void BM_LockWithMutex(benchmark::State& state) { static PerfTestData test_data; for (auto s : state) { RTC_UNUSED(s); - benchmark::DoNotOptimize(test_data.AddToCounter(2)); + int add_to_counter = test_data.AddToCounter(2); + benchmark::DoNotOptimize(add_to_counter); } }