Cemu/src/util/ThreadPool/ThreadPool.h
2022-08-22 22:21:23 +02:00

15 lines
No EOL
327 B
C++

#include <thread>
class ThreadPool
{
public:
template<class TFunction, class... TArgs>
static void FireAndForget(TFunction&& f, TArgs&&... args)
{
// todo - find a way to use std::async here so we can utilize thread pooling?
std::thread t(std::forward<TFunction>(f), std::forward<TArgs>(args)...);
t.detach();
}
};