mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
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:
parent
60282f51f8
commit
65ff0ba1b1
1 changed files with 4 additions and 1 deletions
|
@ -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); });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue