mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 04:24:28 +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
8d3449a90d
commit
83042aa0a2
1 changed files with 4 additions and 1 deletions
|
@ -108,7 +108,10 @@ struct TaskSchedulerImpl
|
||||||
|
|
||||||
for (unsigned i = 0; i < threadCnt; ++i) {
|
for (unsigned i = 0; i < threadCnt; ++i) {
|
||||||
taskQueues.push(new TaskQueue);
|
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