Skip to content

Commit

Permalink
AsyncMessenger: Don't need to join thread if not started
Browse files Browse the repository at this point in the history
Signed-off-by: Haomai Wang <[email protected]>
  • Loading branch information
yuyuyu101 committed Apr 24, 2015
1 parent b05d144 commit 8a7e58e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/msg/async/AsyncMessenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ WorkerPool::WorkerPool(CephContext *c): cct(c), seq(0), started(false),
WorkerPool::~WorkerPool()
{
for (uint64_t i = 0; i < workers.size(); ++i) {
workers[i]->stop();
workers[i]->join();
if (workers[i]->is_started()) {
workers[i]->stop();
workers[i]->join();
}
delete workers[i];
}
}
Expand Down

0 comments on commit 8a7e58e

Please sign in to comment.