1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 71ea90638e)
Signed-off-by: Brad Smith <brad@comstyle.com>
This commit is contained in:
Marton Balint 2024-02-05 00:31:27 +01:00 committed by Brad Smith
parent 66f2cf8958
commit 2aad37688c

View File

@ -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