iw4x-client/src/Utils/Thread.hpp
Louve 678dc349dd
IW5 DLC Prep (#814)
Co-authored-by: FutureRave <edoardo.sanguineti222@gmail.com>
2023-03-17 12:46:29 +00:00

20 lines
468 B
C++

#pragma once
namespace Utils::Thread
{
bool SetName(HANDLE t, const std::string& name);
bool SetName(DWORD id, const std::string& name);
bool SetName(std::thread& t, const std::string& name);
bool SetName(const std::string& name);
template <typename ...Args>
std::thread CreateNamedThread(const std::string& name, Args&&... args)
{
auto t = std::thread(std::forward<Args>(args)...);
SetName(t, name);
return t;
}
std::vector<DWORD> GetThreadIds();
}