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

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-07-18 21:36:58 +0300
committerJean-Baptiste Kempf <jb@videolan.org>2019-07-27 17:18:32 +0300
commit4806492ac3813dbcca1b368c5ef431d8d078e706 (patch)
tree2bda8358b44809104458f741eadde59cada6d58c /src/thread.h
parenta0eb045cd4af0b43cd8a4d954a726048fa6bb85d (diff)
Set thread names on BSDs
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/thread.h b/src/thread.h
index 46f17a0..b0c206d 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -138,6 +138,25 @@ static inline void dav1d_set_thread_name(const char* name) {
prctl(PR_SET_NAME, name);
}
+#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+
+#if defined(__FreeBSD__)
+ /* ALIGN from <sys/param.h> conflicts with ALIGN from "common/attributes.h" */
+#define _SYS_PARAM_H_
+#include <sys/types.h>
+#endif
+#include <pthread_np.h>
+
+static inline void dav1d_set_thread_name(const char* name) {
+ pthread_set_name_np(pthread_self(), name);
+}
+
+#elif defined(__NetBSD__)
+
+static inline void dav1d_set_thread_name(const char* name) {
+ pthread_setname_np(pthread_self(), "%s", (void*)name);
+}
+
#else
#define dav1d_set_thread_name(name)