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

fix: fix the bug that threads don't stop when shared_io_service is released #350

Merged
merged 3 commits into from
Dec 6, 2019
Merged
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
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