Don't allow thread_pool locking to be set by ASIO_CONCURRENCY_HINT_ macros.
Conservatively prevent the thread_pool's internal locking behaviour from being changed via the ASIO_CONCURRENCY_HINT_ macros, as there is no way to use a thread_pool object in a purely single-threaded use case anyway. This change also fixes a conversion warning.
This commit is contained in:
parent
51274de46a
commit
1a7b0c7220
@ -44,8 +44,8 @@ thread_pool::thread_pool()
|
||||
}
|
||||
|
||||
thread_pool::thread_pool(std::size_t num_threads)
|
||||
: scheduler_(add_scheduler(new detail::scheduler(*this, num_threads == 1
|
||||
? ASIO_CONCURRENCY_HINT_1 : num_threads, false)))
|
||||
: scheduler_(add_scheduler(new detail::scheduler(
|
||||
*this, num_threads == 1 ? 1 : 0, false)))
|
||||
{
|
||||
scheduler_.work_started();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user