diff options
author | Mauro Sardara <msardara@cisco.com> | 2020-06-02 18:52:39 +0200 |
---|---|---|
committer | Angelo Mantellini <angelo.mantellini@cisco.com> | 2020-06-03 16:21:49 +0200 |
commit | 5d8156ea4c34f9a3cb986da16a71faebfb2add6b (patch) | |
tree | 5895f7546c91eab1c6cad917f3a41594a543ca64 /libtransport/includes | |
parent | 15458966a342caa0912b7806a755d0d8277ca00f (diff) |
[HICN-622] Add stop() functionality to http proxy.
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I9091cd8ef0f9da869b886541a0116adf3f30e6b9
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Diffstat (limited to 'libtransport/includes')
-rw-r--r-- | libtransport/includes/hicn/transport/utils/event_thread.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libtransport/includes/hicn/transport/utils/event_thread.h b/libtransport/includes/hicn/transport/utils/event_thread.h index db1194821..702c98f8d 100644 --- a/libtransport/includes/hicn/transport/utils/event_thread.h +++ b/libtransport/includes/hicn/transport/utils/event_thread.h @@ -34,7 +34,7 @@ class EventThread { explicit EventThread(asio::io_service& io_service) : internal_io_service_(nullptr), io_service_(io_service), - work_(io_service_), + work_(std::make_unique<asio::io_service::work>(io_service_)), thread_(nullptr) { run(); } @@ -42,7 +42,7 @@ class EventThread { explicit EventThread() : internal_io_service_(std::make_unique<asio::io_service>()), io_service_(*internal_io_service_), - work_(io_service_), + work_(std::make_unique<asio::io_service::work>(io_service_)), thread_(nullptr) { run(); } @@ -78,7 +78,7 @@ class EventThread { } void stop() { - io_service_.stop(); + work_.reset(); if (thread_ && thread_->joinable()) { thread_->join(); @@ -94,7 +94,7 @@ class EventThread { private: std::unique_ptr<asio::io_service> internal_io_service_; asio::io_service& io_service_; - asio::io_service::work work_; + std::unique_ptr<asio::io_service::work> work_; std::unique_ptr<std::thread> thread_; }; |