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