Skip to content
Snippets Groups Projects
Commit efef0d29 authored by Vijay Pai's avatar Vijay Pai Committed by GitHub
Browse files

Merge pull request #7380 from nicolasnoble/no-c++11-threads

Avoid using certain C++11-isms with grpc::thread, as it's not necessarily std::thread.
parents 93e84a51 e053e730
No related branches found
No related tags found
No related merge requests found
...@@ -191,7 +191,7 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> { ...@@ -191,7 +191,7 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> {
// we run some tests without a service, and for those we need to supply a // we run some tests without a service, and for those we need to supply a
// frequently polled completion queue // frequently polled completion queue
cq_ = builder_->AddCompletionQueue(); cq_ = builder_->AddCompletionQueue();
cq_thread_ = grpc::thread(std::bind(&ServerBuilderPluginTest::RunCQ, this)); cq_thread_ = new grpc::thread(&ServerBuilderPluginTest::RunCQ, this);
server_ = builder_->BuildAndStart(); server_ = builder_->BuildAndStart();
EXPECT_TRUE(CheckPresent()); EXPECT_TRUE(CheckPresent());
} }
...@@ -209,7 +209,8 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> { ...@@ -209,7 +209,8 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> {
EXPECT_TRUE(plugin->finish_is_called()); EXPECT_TRUE(plugin->finish_is_called());
server_->Shutdown(); server_->Shutdown();
cq_->Shutdown(); cq_->Shutdown();
cq_thread_.join(); cq_thread_->join();
delete cq_thread_;
} }
string to_string(const int number) { string to_string(const int number) {
...@@ -224,7 +225,7 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> { ...@@ -224,7 +225,7 @@ class ServerBuilderPluginTest : public ::testing::TestWithParam<bool> {
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_; std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
std::unique_ptr<ServerCompletionQueue> cq_; std::unique_ptr<ServerCompletionQueue> cq_;
std::unique_ptr<Server> server_; std::unique_ptr<Server> server_;
grpc::thread cq_thread_; grpc::thread* cq_thread_;
TestServiceImpl service_; TestServiceImpl service_;
int port_; int port_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment