mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
0c0b18615a
Fairly recent Windows SDK is required, unfortunately.
28 lines
466 B
C++
Executable File
28 lines
466 B
C++
Executable File
#ifdef _WIN32
|
|
# include <windows.h>
|
|
#else
|
|
# include <pthread.h>
|
|
# include <unistd.h>
|
|
#endif
|
|
|
|
|
|
#include "TracySystem.hpp"
|
|
|
|
namespace tracy
|
|
{
|
|
|
|
const char* PointerCheckA = "tracy";
|
|
|
|
void SetThreadName( std::thread& thread, const char* name )
|
|
{
|
|
#ifdef _WIN32
|
|
wchar_t buf[256];
|
|
mbstowcs( buf, name, 256 );
|
|
SetThreadDescription( static_cast<HANDLE>( thread.native_handle() ), buf );
|
|
#else
|
|
pthread_setname_np( thread.native_handle(), name );
|
|
#endif
|
|
|
|
}
|
|
|
|
} |