mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-28 22:37:03 +00:00
15 lines
No EOL
327 B
C++
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();
|
|
}
|
|
|
|
|
|
}; |