mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
win32: pthread: use the new thread naming API
Windows, as of the Creators Update, finally has a sane API for giving a name to a thread that can be used by debuggers. This is similar to pthread_setname_np on Linux and some Unixes. Expose it in the pthread wrapper and use it for mpthread_set_name().
This commit is contained in:
@@ -47,7 +47,7 @@ void mpthread_set_name(const char *name)
|
||||
tname[15] = '\0'; // glibc-checked kernel limit
|
||||
pthread_setname_np(pthread_self(), tname);
|
||||
}
|
||||
#elif HAVE_BSD_THREAD_NAME
|
||||
#elif HAVE_WIN32_INTERNAL_PTHREADS || HAVE_BSD_THREAD_NAME
|
||||
pthread_set_name_np(pthread_self(), tname);
|
||||
#elif HAVE_NETBSD_THREAD_NAME
|
||||
pthread_setname_np(pthread_self(), "%s", (void *)tname);
|
||||
|
||||
Reference in New Issue
Block a user