]> git.seodisparate.com - EntityComponentMetaSystem/commitdiff
Fix failing to wait for ThreadPool to finish
authorStephen Seo <seo.disparate@gmail.com>
Tue, 7 Sep 2021 03:24:27 +0000 (12:24 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 7 Sep 2021 03:24:27 +0000 (12:24 +0900)
src/EC/Manager.hpp

index 1160759078c1e26477b3b9888da98cf450da5bb3..78277ea3fb087322046625f83eeeffeff5c5f208 100644 (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());
             }
         }
     };