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);
}
});
BENCHMARK_RELATIVE(ParkingLotNoWaitersWake, iters) {
BenchmarkSuspender susp;
- folly::detail::Futex<> fu;
SimpleBarrier b(FLAGS_threads + 1);
std::vector<std::thread> 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; });
}
});
}
susp.dismiss();
b.wait();
- for (int i = 0; i < iters; i++) {
+ for (auto i = 0u; i < iters; i++) {
fu.futexWake(1);
}
fu.store(1);
}
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;
}
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);
}
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;