aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/server_async.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-10-17 13:56:13 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-10-17 13:56:13 -0700
commit14c836fcd10e4f96ae1f4ac22fe43d42e2e293ba (patch)
treec05471f028482aa52a87f61d8c030aaaaddef91c /test/cpp/qps/server_async.cc
parent68cf8ce8662e58aa1ebdb2dbccbb8bc270f8aade (diff)
Delambdaify
Diffstat (limited to 'test/cpp/qps/server_async.cc')
-rw-r--r--test/cpp/qps/server_async.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 191c6566ad..73a96a8443 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -131,12 +131,7 @@ class AsyncQpsServerTest : public Server {
std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true;
}
- // TODO (vpai): Remove this deadline and allow Shutdown to finish properly
- std::thread shutdown_thread([this]() {
- auto deadline =
- std::chrono::system_clock::now() + std::chrono::seconds(3);
- server_->Shutdown(deadline);
- });
+ std::thread shutdown_thread(&AsyncQpsServerTest::ShutdownThreadFunc, this);
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) {
(*cq)->Shutdown();
}
@@ -153,6 +148,12 @@ class AsyncQpsServerTest : public Server {
}
private:
+ void ShutdownThreadFunc() {
+ // TODO (vpai): Remove this deadline and allow Shutdown to finish properly
+ auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(3);
+ server_->Shutdown(deadline);
+ }
+
void ThreadFunc(int thread_idx) {
// Wait until work is available or we are shutting down
bool ok;