summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2024-02-05 00:31:27 +0100
committerMarton Balint <cus@passwd.hu>2024-02-05 09:42:30 +0100
commit71ea90638efa56b4cd006bfa6cfb464d2169692d (patch)
treebefe5ab74a5f3c1f0cdec0fee313180e608d8ed9
parentd3111486f917f61df4100beb0cedc8e84cd7d2f7 (diff)
avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple
Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavutil/thread.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/thread.h b/libavutil/thread.h
index fa74dd2ea7..2c00c7cc35 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -220,7 +220,13 @@ static inline int ff_thread_setname(const char *name)
#if HAVE_PRCTL
ret = AVERROR(prctl(PR_SET_NAME, name));
#elif HAVE_PTHREAD_SETNAME_NP
+#if defined(__APPLE__)
+ ret = AVERROR(pthread_setname_np(name));
+#elif defined(__NetBSD__)
+ ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name));
+#else
ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#endif
#elif HAVE_PTHREAD_SET_NAME_NP
pthread_set_name_np(pthread_self(), name);
#else