clang-format

pull/7652/head
Vijay Pai 9 years ago
parent 25128f1adf
commit d02988d6b5
  1. 14
      test/cpp/qps/client.h
  2. 24
      test/cpp/qps/client_sync.cc

@ -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;

@ -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;

Loading…
Cancel
Save