From d02988d6b55c7724548ed556c319222f5e2cf665 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 5 Aug 2016 09:47:47 -0700 Subject: [PATCH] clang-format --- test/cpp/qps/client.h | 14 +++++--------- test/cpp/qps/client_sync.cc | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 1f98a7fc286..5b1a1c3b827 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -244,13 +244,9 @@ class Client { class Thread { public: Thread(Client* client, size_t idx) - : client_(client), - idx_(idx), - impl_(&Thread::ThreadFunc, this) {} + : client_(client), idx_(idx), impl_(&Thread::ThreadFunc, this) {} - ~Thread() { - impl_.join(); - } + ~Thread() { impl_.join(); } void BeginSwap(Histogram* n) { std::lock_guard g(mu_); @@ -278,13 +274,13 @@ class Client { if (entry.used()) { histogram_.Add(entry.value()); } - bool done = false; + bool done = false; if (!thread_still_ok) { gpr_log(GPR_ERROR, "Finishing client thread due to RPC error"); done = true; } - done = done || (gpr_atm_acq_load(&client_->thread_pool_done_) != - static_cast(0)); + done = done || (gpr_atm_acq_load(&client_->thread_pool_done_) != + static_cast(0)); if (done) { client_->CompleteThread(); return; diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index b677fc1070e..53e004ffa02 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -87,18 +87,18 @@ class SynchronousClient // need to terminate before then. This is an issue since // exponential distribution can occasionally produce bad outliers while (true) { - gpr_timespec one_sec_delay = - gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(1, GPR_TIMESPAN)); - if (gpr_time_cmp(next_issue_time, one_sec_delay) <= 0) { - gpr_sleep_until(next_issue_time); - return true; - } else { - gpr_sleep_until(one_sec_delay); - if (gpr_atm_acq_load(&thread_pool_done_) != static_cast(0)) { - return false; - } - } + gpr_timespec one_sec_delay = + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), + gpr_time_from_seconds(1, GPR_TIMESPAN)); + if (gpr_time_cmp(next_issue_time, one_sec_delay) <= 0) { + gpr_sleep_until(next_issue_time); + return true; + } else { + gpr_sleep_until(one_sec_delay); + if (gpr_atm_acq_load(&thread_pool_done_) != static_cast(0)) { + return false; + } + } } } return true;