use unique_ptr to network_thread_pool
This commit is contained in:
parent
0682e6146c
commit
2c00a613b2
|
@ -760,7 +760,7 @@ namespace libtorrent
|
||||||
|
|
||||||
// a thread pool used for async_write_some calls,
|
// a thread pool used for async_write_some calls,
|
||||||
// to distribute its cost to multiple threads
|
// 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
|
// the bandwidth manager is responsible for
|
||||||
// handing out bandwidth to connections that
|
// handing out bandwidth to connections that
|
||||||
|
|
|
@ -6083,7 +6083,7 @@ namespace aux {
|
||||||
int num_pools = num_threads > 0 ? num_threads : 1;
|
int num_pools = num_threads > 0 ? num_threads : 1;
|
||||||
while (num_pools > m_net_thread_pool.size())
|
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);
|
m_net_thread_pool.back()->set_num_threads(num_threads > 0 ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue