fixing some data races

This commit is contained in:
2025-06-03 21:57:47 +02:00
parent 66c42af1b8
commit da4a141c85
6 changed files with 49 additions and 23 deletions

View File

@@ -16,7 +16,7 @@ class ThreadPool
inline void WaitForAllTasks() const
{
using namespace std::chrono_literals;
for(; m_waiting_count != m_concurency;)
for(; m_waiting_count != m_concurency && !m_tasks.IsEmpty();)
std::this_thread::sleep_for(10ms);
}
~ThreadPool();