diff --git a/src/kernel/pthread.cpp b/src/kernel/pthread.cpp index 21be846ce..673a7dc72 100644 --- a/src/kernel/pthread.cpp +++ b/src/kernel/pthread.cpp @@ -3202,7 +3202,11 @@ static void* RunThread(void* arg) { thread->host_thread_id = os_thread_id; #if KYTY_PLATFORM == KYTY_PLATFORM_LINUX if (!thread->name.empty()) { +#if defined(__APPLE__) + pthread_setname_np(thread->name.substr(0, 63).c_str()); +#else pthread_setname_np(pthread_self(), thread->name.substr(0, 15).c_str()); +#endif } #endif