Fix #33107: cycles fixed threads 1 was still having two cores do work,
because main thread works as well.
This commit is contained in:
@@ -168,10 +168,16 @@ void TaskScheduler::init(int num_threads)
|
||||
if(users == 0) {
|
||||
do_exit = false;
|
||||
|
||||
/* launch threads that will be waiting for work */
|
||||
if(num_threads == 0)
|
||||
if(num_threads == 0) {
|
||||
/* automatic number of threads will be main thread + num cores */
|
||||
num_threads = system_cpu_thread_count();
|
||||
}
|
||||
else {
|
||||
/* main thread will also work, for fixed threads we count it too */
|
||||
num_threads -= 1;
|
||||
}
|
||||
|
||||
/* launch threads that will be waiting for work */
|
||||
threads.resize(num_threads);
|
||||
thread_level.resize(num_threads);
|
||||
|
||||
|
Reference in New Issue
Block a user