#include #include #if PLATFORM_WINDOWS #include #include #elif PLATFORM_LINUX #include #elif PLATFORM_MACOS #include #endif void set_thread_name(const char* name) { #if PLATFORM_WINDOWS SetThreadDescription(GetCurrentThread(), std::wstring(name, name + strlen(name)).c_str()); #elif PLATFORM_LINUX pthread_setname_np(pthread_self(), name); #elif PLATFORM_MACOS pthread_setname_np(name); #endif }