From: Stephen Seo Date: Tue, 7 Sep 2021 03:24:27 +0000 (+0900) Subject: Fix failing to wait for ThreadPool to finish X-Git-Tag: 1.0~33 X-Git-Url: https://git.seodisparate.com/stephenseo/static/search/searchdata.js?a=commitdiff_plain;h=dc7c29f7cc2405844d48c794e7a58fc9cc2ed4a7;p=EntityComponentMetaSystem Fix failing to wait for ThreadPool to finish --- diff --git a/src/EC/Manager.hpp b/src/EC/Manager.hpp index 1160759..78277ea 100644 --- a/src/EC/Manager.hpp +++ b/src/EC/Manager.hpp @@ -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()); } } };