Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-10-18 19:10:01 +0300
committerAnton Khirnov <anton@khirnov.net>2022-10-24 03:00:31 +0300
commitf66e7946724a102c67bf03faaca7517d8ee2fcd9 (patch)
tree30cff9122e8d2fb359a3aaf7abc5084b6c171cca /libavutil/thread.h
parent5ec9d26b2b50c535c07c0c8fb69650fbad0be892 (diff)
lavu/thread: add an internal function for setting thread name
Linux-only for now.
Diffstat (limited to 'libavutil/thread.h')
-rw-r--r--libavutil/thread.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/libavutil/thread.h b/libavutil/thread.h
index 7106fd0d47..2f5e7e1cb5 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -24,6 +24,12 @@
#include "config.h"
+#if HAVE_PRCTL
+#include <sys/prctl.h>
+#endif
+
+#include "error.h"
+
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
#if HAVE_PTHREADS
@@ -33,7 +39,6 @@
#include <stdlib.h>
-#include "error.h"
#include "log.h"
#include "macros.h"
@@ -187,4 +192,13 @@ static inline int ff_thread_once(char *control, void (*routine)(void))
#endif
+static inline int ff_thread_setname(const char *name)
+{
+#if HAVE_PRCTL
+ return AVERROR(prctl(PR_SET_NAME, name));
+#endif
+
+ return AVERROR(ENOSYS);
+}
+
#endif /* AVUTIL_THREAD_H */