mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-06-07 07:03:38 +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 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__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user