Skip to content
Snippets Groups Projects
Commit 14c836fc authored by Craig Tiller's avatar Craig Tiller
Browse files

Delambdaify

parent 68cf8ce8
No related branches found
No related tags found
No related merge requests found
...@@ -131,12 +131,7 @@ class AsyncQpsServerTest : public Server { ...@@ -131,12 +131,7 @@ class AsyncQpsServerTest : public Server {
std::lock_guard<std::mutex> lock((*ss)->mutex); std::lock_guard<std::mutex> lock((*ss)->mutex);
(*ss)->shutdown = true; (*ss)->shutdown = true;
} }
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly std::thread shutdown_thread(&AsyncQpsServerTest::ShutdownThreadFunc, this);
std::thread shutdown_thread([this]() {
auto deadline =
std::chrono::system_clock::now() + std::chrono::seconds(3);
server_->Shutdown(deadline);
});
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) { for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) {
(*cq)->Shutdown(); (*cq)->Shutdown();
} }
...@@ -153,6 +148,12 @@ class AsyncQpsServerTest : public Server { ...@@ -153,6 +148,12 @@ class AsyncQpsServerTest : public Server {
} }
private: 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) { void ThreadFunc(int thread_idx) {
// Wait until work is available or we are shutting down // Wait until work is available or we are shutting down
bool ok; bool ok;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment