#include #include #include #include static std::vector> threads; int Palladium::Tasks::Create(std::function fun) { auto thrd = std::make_shared(fun); threads.push_back(thrd); return threads.size(); } void Palladium::Tasks::DestroyAll() { for (auto& it : threads) { if (it && it->joinable()) { it->join(); } } // Delete Pointers threads.clear(); }