From: Yedidya Feldblum Date: Wed, 17 Jan 2018 02:19:38 +0000 (-0800) Subject: Fix Build: folly/synchronization/test/ParkingLotBenchmark.cpp (sign-compare, unused... X-Git-Tag: v2018.01.22.00~25 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61cdb3dc27700545a65062e174d1b7f1ac15f088;p=folly.git Fix Build: folly/synchronization/test/ParkingLotBenchmark.cpp (sign-compare, unused-variable) Summary: [Folly] Fix Build: `folly/synchronization/test/ParkingLotBenchmark.cpp` (`sign-compare`, `unused-variable`). Reviewed By: djwatson Differential Revision: D6733586 fbshipit-source-id: 04b82110e8e0b655e6b3994dbca3bd0b4bd57eef --- diff --git a/folly/synchronization/test/ParkingLotBenchmark.cpp b/folly/synchronization/test/ParkingLotBenchmark.cpp index febc5609..266c5180 100644 --- a/folly/synchronization/test/ParkingLotBenchmark.cpp +++ b/folly/synchronization/test/ParkingLotBenchmark.cpp @@ -61,7 +61,7 @@ BENCHMARK(FutexNoWaitersWake, iters) { for (auto& t : threads) { t = std::thread([&]() { b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { fu.futexWake(1); } }); @@ -76,14 +76,13 @@ BENCHMARK(FutexNoWaitersWake, iters) { BENCHMARK_RELATIVE(ParkingLotNoWaitersWake, iters) { BenchmarkSuspender susp; - folly::detail::Futex<> fu; SimpleBarrier b(FLAGS_threads + 1); std::vector threads{FLAGS_threads}; for (auto& t : threads) { t = std::thread([&]() { b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { lot.unpark(&lot, [](Unit) { return UnparkControl::RetainContinue; }); } }); @@ -115,7 +114,7 @@ BENCHMARK(FutexWakeOne, iters) { } susp.dismiss(); b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { fu.futexWake(1); } fu.store(1); @@ -150,7 +149,7 @@ BENCHMARK_RELATIVE(ParkingLotWakeOne, iters) { } susp.dismiss(); b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { lot.unpark(&done, [](Unit) { return UnparkControl::RemoveBreak; }); } done = true; @@ -181,7 +180,7 @@ BENCHMARK(FutexWakeAll, iters) { } susp.dismiss(); b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { fu.futexWake(threads.size()); } fu.store(1); @@ -217,7 +216,7 @@ BENCHMARK_RELATIVE(ParkingLotWakeAll, iters) { } susp.dismiss(); b.wait(); - for (int i = 0; i < iters; i++) { + for (auto i = 0u; i < iters; i++) { lot.unpark(&done, [](Unit) { return UnparkControl::RemoveContinue; }); } done = true;