diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /media/ffvpx/libavutil/thread.h | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'media/ffvpx/libavutil/thread.h')
-rw-r--r-- | media/ffvpx/libavutil/thread.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/media/ffvpx/libavutil/thread.h b/media/ffvpx/libavutil/thread.h index 2ded498c89..2c00c7cc35 100644 --- a/media/ffvpx/libavutil/thread.h +++ b/media/ffvpx/libavutil/thread.h @@ -26,6 +26,8 @@ #if HAVE_PRCTL #include <sys/prctl.h> +#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) && HAVE_PTHREAD_NP_H +#include <pthread_np.h> #endif #include "error.h" @@ -213,11 +215,25 @@ static inline int ff_thread_once(char *control, void (*routine)(void)) static inline int ff_thread_setname(const char *name) { + int ret = 0; + #if HAVE_PRCTL - return AVERROR(prctl(PR_SET_NAME, name)); + 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 + ret = AVERROR(ENOSYS); #endif - return AVERROR(ENOSYS); + return ret; } #endif /* AVUTIL_THREAD_H */ |