Revert removal of Teardown call

As per review recommendation.
This commit is contained in:
Stuart Kenny 2021-07-08 15:39:51 +01:00
parent 02a24cdb7d
commit 96454fcbb6

View File

@ -98,6 +98,10 @@ static void WorkerThreadFunc(GlobalThreadContext *global, ThreadContext *thread)
}
void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) {
if (!global_->threads_.empty()) {
Teardown();
}
numComputeThreads_ = std::min(numRealCores * numLogicalCoresPerCpu, MAX_CORES_TO_USE);
int numThreads = numComputeThreads_ + EXTRA_THREADS;
numThreads_ = numThreads;