mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-12-08 13:15:09 +00:00
Ensure ThreadMap is locked on modification
This commit is contained in:
@@ -48,7 +48,9 @@ static Module Log("logvisor");
|
||||
static std::unordered_map<std::thread::id, const char*> ThreadMap;
|
||||
void RegisterThreadName(const char* name)
|
||||
{
|
||||
auto lk = LockLog();
|
||||
ThreadMap[std::this_thread::get_id()] = name;
|
||||
lk.unlock();
|
||||
#if __APPLE__
|
||||
pthread_setname_np(name);
|
||||
#elif __linux__
|
||||
|
||||
Reference in New Issue
Block a user