common taskScheduler: fix wrong thread indexing due to duplicated variable names.

That mistake could invoke inproper threads....
This commit is contained in:
Hermet Park 2021-06-07 12:55:44 +09:00
parent ae5673658e
commit 9873539b04

View file

@ -127,8 +127,8 @@ public:
//Thread Loop
while (true) {
auto success = false;
for (unsigned i = 0; i < threadCnt * 2; ++i) {
if (taskQueues[(i + i) % threadCnt].tryPop(&task)) {
for (unsigned x = 0; x < threadCnt * 2; ++x) {
if (taskQueues[(i + x) % threadCnt].tryPop(&task)) {
success = true;
break;
}