diff mbox series

[FFmpeg-devel] avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

Message ID 20240204233250.32320-1-cus@passwd.hu
State Accepted
Commit 71ea90638efa56b4cd006bfa6cfb464d2169692d
Headers show
Series [FFmpeg-devel] avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marton Balint Feb. 4, 2024, 11:32 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavutil/thread.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Connor Worley Feb. 5, 2024, 8:17 a.m. UTC | #1
Can confirm this fixes the build on my Mac.
Marton Balint Feb. 5, 2024, 8:45 a.m. UTC | #2
On Mon, 5 Feb 2024, Connor Worley wrote:

> Can confirm this fixes the build on my Mac.

Thanks, will apply.

Regards,
Marton

>
> -- 
> Connor Worley
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
diff mbox series

Patch

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