Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent erroneous join #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion async_grpc/completion_queue_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ void CompletionQueue::Shutdown() {
CHECK(thread_) << "CompletionQueue not yet started.";
LOG(INFO) << "Shutting down client completion queue " << this;
completion_queue_.Shutdown();
thread_->join();
if (thread_->joinable()) {
thread_->join();
}
}

void CompletionQueue::RunCompletionQueue() {
Expand Down
4 changes: 3 additions & 1 deletion async_grpc/completion_queue_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ void CompletionQueueThread::Start(CompletionQueueRunner runner) {
void CompletionQueueThread::Shutdown() {
LOG(INFO) << "Shutting down completion queue " << completion_queue_.get();
completion_queue_->Shutdown();
worker_thread_->join();
if (worker_thread_->joinable()) {
worker_thread_->join();
}
}

} // namespace async_grpc
4 changes: 3 additions & 1 deletion async_grpc/event_queue_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ void EventQueueThread::Start(EventQueueRunner runner) {

void EventQueueThread::Shutdown() {
LOG(INFO) << "Shutting down event queue " << event_queue_.get();
thread_->join();
if (thread_->joinable()) {
thread_->join();
}
}

} // namespace async_grpc