Fix failing to wait for ThreadPool to finish

This commit is contained in:
Stephen Seo 2021-09-07 12:24:27 +09:00
parent d32c6d8d40
commit dc7c29f7cc

View file

@ -695,7 +695,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
@ -814,7 +814,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
@ -958,7 +958,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
})));
@ -1037,7 +1037,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
return matchingV;
@ -1424,7 +1424,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
// call functions on matching entities
@ -1486,7 +1486,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
);
@ -1625,7 +1625,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
// call functions on matching entities
@ -1692,7 +1692,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
);
@ -1765,7 +1765,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
@ -1854,7 +1854,7 @@ namespace EC
threadPool->wakeThreads();
do {
std::this_thread::sleep_for(std::chrono::microseconds(200));
} while(!threadPool->isQueueEmpty() && !threadPool->isAllThreadsWaiting());
} while(!threadPool->isQueueEmpty() || !threadPool->isAllThreadsWaiting());
}
}
};