diff options
author | Vijay Pai <vpai@google.com> | 2016-08-05 09:47:47 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-08-05 09:47:47 -0700 |
commit | d02988d6b55c7724548ed556c319222f5e2cf665 (patch) | |
tree | 73592e9dcc11ffcd83494003d3641c129561c559 /test | |
parent | 25128f1adf836e63cf76b6666fba8bcf31d7a5a8 (diff) |
clang-format
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/qps/client.h | 14 | ||||
-rw-r--r-- | 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 1f98a7fc28..5b1a1c3b82 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<std::mutex> 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<gpr_atm>(0)); + done = done || (gpr_atm_acq_load(&client_->thread_pool_done_) != + static_cast<gpr_atm>(0)); if (done) { client_->CompleteThread(); return; diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index b677fc1070..53e004ffa0 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<gpr_atm>(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<gpr_atm>(0)) { + return false; + } + } } } return true; |