Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
fix: fix the bug that threads don't stop when shared_io_service is re…
Browse files Browse the repository at this point in the history
…leased (#350)
  • Loading branch information
zhao liwei authored and acelyc111 committed Dec 30, 2019
1 parent 9256ae1 commit 9c73214
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/tools/common/shared_io_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class shared_io_service : public utils::singleton<shared_io_service>
}
}

~shared_io_service()
{
ios.stop();
for (auto worker : _workers) {
worker->join();
}
}

boost::asio::io_service ios;

private:
Expand Down

0 comments on commit 9c73214

Please sign in to comment.