From 5d8156ea4c34f9a3cb986da16a71faebfb2add6b Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 2 Jun 2020 18:52:39 +0200 Subject: [HICN-622] Add stop() functionality to http proxy. Signed-off-by: Mauro Sardara Change-Id: I9091cd8ef0f9da869b886541a0116adf3f30e6b9 Signed-off-by: Angelo Mantellini --- libtransport/includes/hicn/transport/utils/event_thread.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libtransport/includes/hicn/transport/utils/event_thread.h') 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(io_service_)), thread_(nullptr) { run(); } @@ -42,7 +42,7 @@ class EventThread { explicit EventThread() : internal_io_service_(std::make_unique()), io_service_(*internal_io_service_), - work_(io_service_), + work_(std::make_unique(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 internal_io_service_; asio::io_service& io_service_; - asio::io_service::work work_; + std::unique_ptr work_; std::unique_ptr thread_; }; -- cgit 1.2.3-korg