summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-10-22 04:46:48 +0200
committerDudemanguy <random342@airmail.cc>2023-11-05 17:36:17 +0000
commit751790c2b3171f614576a990f44bf28b7efe4580 (patch)
tree3dea26b823af419a7bdbd0984d94a8a5826f9bf0 /osdep
parentf75fe33da7d01fee2fa9365f926060fc7ffb74d0 (diff)
downloadmpv-751790c2b3171f614576a990f44bf28b7efe4580.tar.bz2
mpv-751790c2b3171f614576a990f44bf28b7efe4580.tar.xz
threads: remove unused code
Diffstat (limited to 'osdep')
-rw-r--r--osdep/threads-posix.c25
-rw-r--r--osdep/threads.h8
2 files changed, 0 insertions, 33 deletions
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 <pthread_np.h>
#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 <pthread.h>
-
#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,