use unique_ptr to network_thread_pool

This commit is contained in:
Steven Siloti 2016-04-30 13:25:50 -07:00
parent 0682e6146c
commit 2c00a613b2
2 changed files with 2 additions and 2 deletions

View File

@ -760,7 +760,7 @@ namespace libtorrent
// a thread pool used for async_write_some calls,
// to distribute its cost to multiple threads
std::vector<boost::shared_ptr<network_thread_pool> > m_net_thread_pool;
std::vector<std::unique_ptr<network_thread_pool>> m_net_thread_pool;
// the bandwidth manager is responsible for
// handing out bandwidth to connections that

View File

@ -6083,7 +6083,7 @@ namespace aux {
int num_pools = num_threads > 0 ? num_threads : 1;
while (num_pools > m_net_thread_pool.size())
{
m_net_thread_pool.push_back(boost::make_shared<network_thread_pool>());
m_net_thread_pool.emplace_back(new network_thread_pool());
m_net_thread_pool.back()->set_num_threads(num_threads > 0 ? 1 : 0);
}