SetThreadName only works on MSVC for now

This commit is contained in:
darkf 2020-04-06 19:05:34 -07:00
parent b2a5f304bf
commit e4371adf5e
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,7 @@ typedef struct tagTHREADNAME_INFO
} THREADNAME_INFO;
#pragma pack(pop)
#ifdef _MSC_VER
void SetThreadName(DWORD dwThreadID, const char* szThreadName)
{
if (!IsDebuggerPresent())
@ -61,6 +62,12 @@ void SetThreadName(DWORD dwThreadID, const char* szThreadName)
__except (EXCEPTION_EXECUTE_HANDLER) {
}
}
#else
void SetThreadName(DWORD dwThreadID, const char* szThreadName)
{
// TODO: Use SetThreadDescription
}
#endif
void SetCurrentThreadName(const char* szThreadName)
{