renderer/taskscheduler: Resolve a thread sanitizer report.

Since each thread worker accesses the 'threads.count' variable,
delay the thread starting until initialization is completed.
This commit is contained in:
Hermet Park 2023-12-28 21:33:26 +09:00 committed by Hermet Park
parent 8d3449a90d
commit 83042aa0a2

View file

@ -108,7 +108,10 @@ struct TaskSchedulerImpl
for (unsigned i = 0; i < threadCnt; ++i) {
taskQueues.push(new TaskQueue);
threads.push(new thread([&, i] { run(i); }));
threads.push(new thread);
}
for (unsigned i = 0; i < threadCnt; ++i) {
*threads.data[i] = thread([&, i] { run(i); });
}
}