mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-12-09 13:37:53 +00:00
Fix MSVC compile fail
This commit is contained in:
@@ -46,11 +46,16 @@ namespace logvisor
|
|||||||
static Module Log("logvisor");
|
static Module Log("logvisor");
|
||||||
|
|
||||||
static std::unordered_map<std::thread::id, const char*> ThreadMap;
|
static std::unordered_map<std::thread::id, const char*> ThreadMap;
|
||||||
void RegisterThreadName(const char* name)
|
|
||||||
|
static void AddThreadToMap(const char* name)
|
||||||
{
|
{
|
||||||
auto lk = LockLog();
|
auto lk = LockLog();
|
||||||
ThreadMap[std::this_thread::get_id()] = name;
|
ThreadMap[std::this_thread::get_id()] = name;
|
||||||
lk.unlock();
|
}
|
||||||
|
|
||||||
|
void RegisterThreadName(const char* name)
|
||||||
|
{
|
||||||
|
AddThreadToMap(name);
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
pthread_setname_np(name);
|
pthread_setname_np(name);
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
|
|||||||
Reference in New Issue
Block a user