summaryrefslogtreecommitdiffstats
path: root/osdep/threads-posix.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:13:14 +0000
commit5a3b54c78ce63d899f76dbb3db72e4894b40bd53 (patch)
tree50693d13eeefc4d683bdf5417f0861b0ef274a0c /osdep/threads-posix.h
parentAdding debian version 0.37.0-1. (diff)
downloadmpv-5a3b54c78ce63d899f76dbb3db72e4894b40bd53.tar.xz
mpv-5a3b54c78ce63d899f76dbb3db72e4894b40bd53.zip
Merging upstream version 0.38.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'osdep/threads-posix.h')
-rw-r--r--osdep/threads-posix.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/osdep/threads-posix.h b/osdep/threads-posix.h
index 482e4a8..4b3bb90 100644
--- a/osdep/threads-posix.h
+++ b/osdep/threads-posix.h
@@ -23,6 +23,11 @@
#include "common/common.h"
#include "config.h"
+// We make use of NON-POSIX pthreads functions and certain systems
+// require this header to build without issues. (ex: OpenBSD)
+#if HAVE_BSD_THREAD_NAME
+#include <pthread_np.h>
+#endif
#include "osdep/compiler.h"
#include "timer.h"
@@ -97,7 +102,7 @@ typedef pthread_once_t mp_once;
typedef pthread_t mp_thread_id;
typedef pthread_t mp_thread;
-#define MP_STATIC_COND_INITIALIZER (mp_cond){ .cond = PTHREAD_COND_INITIALIZER, .clk_id = CLOCK_REALTIME }
+#define MP_STATIC_COND_INITIALIZER { .cond = PTHREAD_COND_INITIALIZER, .clk_id = CLOCK_REALTIME }
#define MP_STATIC_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
#define MP_STATIC_ONCE_INITIALIZER PTHREAD_ONCE_INIT
@@ -230,7 +235,7 @@ static inline void mp_thread_set_name(const char *name)
}
#elif HAVE_BSD_THREAD_NAME
pthread_set_name_np(pthread_self(), name);
-#elif HAVE_OSX_THREAD_NAME
+#elif HAVE_MAC_THREAD_NAME
pthread_setname_np(name);
#endif
}