Fix MSVC compile fail

This commit is contained in:
Jack Andersen 2017-01-16 15:30:32 -10:00
parent 362499716c
commit b229c2f8fe
1 changed files with 7 additions and 2 deletions

View File

@ -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__