Ensure Extractor scheduler is requested with non-Zero number of threads.

By default, ExtractorConfig::requested_num_threads is Zero,
which is an invalid value for tbb task scheduler.
If user does not specify value greater than Zero, then
use tbb::task_scheduler_init::automatic.
This commit is contained in:
Mateusz Łoskot 2017-03-08 16:00:56 +01:00 committed by Daniel J. H
parent 0a13390ab0
commit e705ff16e3

View File

@ -119,7 +119,8 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
const unsigned recommended_num_threads = tbb::task_scheduler_init::default_num_threads();
const auto number_of_threads = std::min(recommended_num_threads, config.requested_num_threads);
tbb::task_scheduler_init init(number_of_threads);
tbb::task_scheduler_init init(number_of_threads ? number_of_threads
: tbb::task_scheduler_init::automatic);
{
util::Log() << "Input file: " << config.input_path.filename().string();