Sta::setThreadCount only make threads if >1

This commit is contained in:
James Cherry 2021-01-20 19:30:05 -07:00
parent ed7d2dcc36
commit 9fd5d68bf4
1 changed files with 4 additions and 3 deletions

View File

@ -320,9 +320,10 @@ void
Sta::setThreadCount(int thread_count)
{
thread_count_ = thread_count;
// dispatch_queue_->setThreadCount(thread_count);
delete dispatch_queue_;
dispatch_queue_ = new DispatchQueue(thread_count);
if (dispatch_queue_)
dispatch_queue_->setThreadCount(thread_count);
else if (thread_count > 1)
dispatch_queue_ = new DispatchQueue(thread_count);
updateComponentsState();
}