From 2dded9b7353f7eb0895c9e197b27764705ca4135 Mon Sep 17 00:00:00 2001 From: zhao liwei Date: Wed, 8 Jan 2020 09:24:00 +0800 Subject: [PATCH] fix: fix the bug that threads don't stop when pegasus_io_service is released (#455) --- rdsn | 2 +- src/reporter/pegasus_io_service.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rdsn b/rdsn index 9679e40fcd..d1cb30c6b0 160000 --- a/rdsn +++ b/rdsn @@ -1 +1 @@ -Subproject commit 9679e40fcd86edff5018bad67e8ba2c74412fd44 +Subproject commit d1cb30c6b0a3b9f08cf2501e8f193c7be4e87965 diff --git a/src/reporter/pegasus_io_service.h b/src/reporter/pegasus_io_service.h index 396a1e2d66..6db9c739e9 100644 --- a/src/reporter/pegasus_io_service.h +++ b/src/reporter/pegasus_io_service.h @@ -30,6 +30,14 @@ class pegasus_io_service : public ::dsn::utils::singleton } } + ~pegasus_io_service() + { + ios.stop(); + for (auto worker : _workers) { + worker->join(); + } + } + boost::asio::io_service ios; private: