diff --git a/osdep/threads-posix.c b/osdep/threads-posix.c index b9ead75723..0b09a7c924 100644 --- a/osdep/threads-posix.c +++ b/osdep/threads-posix.c @@ -27,31 +27,6 @@ #include #endif -int mpthread_mutex_init_recursive(pthread_mutex_t *mutex) -{ - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - int r = pthread_mutex_init(mutex, &attr); - pthread_mutexattr_destroy(&attr); - return r; -} - -void mpthread_set_name(const char *name) -{ -#if HAVE_GLIBC_THREAD_NAME - if (pthread_setname_np(pthread_self(), name) == ERANGE) { - char tname[16] = {0}; // glibc-checked kernel limit - strncpy(tname, name, sizeof(tname) - 1); - pthread_setname_np(pthread_self(), tname); - } -#elif HAVE_BSD_THREAD_NAME - pthread_set_name_np(pthread_self(), name); -#elif HAVE_OSX_THREAD_NAME - pthread_setname_np(name); -#endif -} - int mp_ptwrap_check(const char *file, int line, int res) { if (res && res != ETIMEDOUT) { diff --git a/osdep/threads.h b/osdep/threads.h index bfa3815fe6..a3d1b3a569 100644 --- a/osdep/threads.h +++ b/osdep/threads.h @@ -1,16 +1,8 @@ #ifndef MP_OSDEP_THREADS_H_ #define MP_OSDEP_THREADS_H_ -#include - #include "config.h" -// Helper to reduce boiler plate. -int mpthread_mutex_init_recursive(pthread_mutex_t *mutex); - -// Set thread name (for debuggers). -void mpthread_set_name(const char *name); - enum mp_mutex_type { MP_MUTEX_NORMAL = 0, MP_MUTEX_RECURSIVE,