From 0fe8f4ded44aacd63248380ecd60574534dc8c7a Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Sat, 24 Sep 2016 09:51:39 +1000 Subject: [PATCH] A smart pointer is not required to hold the work. --- asio/src/examples/cpp03/http/server2/io_context_pool.cpp | 3 +-- asio/src/examples/cpp03/http/server2/io_context_pool.hpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/asio/src/examples/cpp03/http/server2/io_context_pool.cpp b/asio/src/examples/cpp03/http/server2/io_context_pool.cpp index 9ce0fc44..049ac988 100644 --- a/asio/src/examples/cpp03/http/server2/io_context_pool.cpp +++ b/asio/src/examples/cpp03/http/server2/io_context_pool.cpp @@ -27,9 +27,8 @@ io_context_pool::io_context_pool(std::size_t pool_size) for (std::size_t i = 0; i < pool_size; ++i) { io_context_ptr io_context(new asio::io_context); - work_ptr work(new io_context_work(asio::make_work_guard(*io_context))); io_contexts_.push_back(io_context); - work_.push_back(work); + work_.push_back(asio::make_work_guard(*io_context)); } } diff --git a/asio/src/examples/cpp03/http/server2/io_context_pool.hpp b/asio/src/examples/cpp03/http/server2/io_context_pool.hpp index a20f489f..6a573c53 100644 --- a/asio/src/examples/cpp03/http/server2/io_context_pool.hpp +++ b/asio/src/examples/cpp03/http/server2/io_context_pool.hpp @@ -40,13 +40,12 @@ private: typedef boost::shared_ptr io_context_ptr; typedef asio::executor_work_guard< asio::io_context::executor_type> io_context_work; - typedef boost::shared_ptr work_ptr; /// The pool of io_contexts. std::vector io_contexts_; /// The work that keeps the io_contexts running. - std::vector work_; + std::vector work_; /// The next io_context to use for a connection. std::size_t next_io_context_;