Skip to content

Commit

Permalink
Minor improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabrizian committed Oct 11, 2023
1 parent ab91e7d commit fd4f8bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/python_be.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1705,12 +1705,13 @@ ModelInstanceState::~ModelInstanceState()
if (Stub()->IsHealthy()) {
if (model_state->IsDecoupled()) {
// Wait for all the pending tasks to finish.
thread_pool_->join();
thread_pool_->wait();
// Push a dummy message to signal the thread to terminate.
Stub()->ParentMessageQueue()->Push(DUMMY_MESSAGE);
decoupled_monitor_.join();
} else {
thread_pool_->wait();
}
thread_pool_->wait();
}
// Terminate stub first to allow any last messages to be received by the back
// end before deallocating the queue memory
Expand Down

0 comments on commit fd4f8bb

Please sign in to comment.