Mesa (master): util/u_thread: include pthread_np.h if found
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 31 09:28:27 UTC 2020
Module: Mesa
Branch: master
Commit: 55765f80b9ce7cce4ec6a1c2bed6476776d9cbed
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=55765f80b9ce7cce4ec6a1c2bed6476776d9cbed
Author: Jonathan Gray <jsg at jsg.id.au>
Date: Wed Jun 24 23:27:52 2020 +1000
util/u_thread: include pthread_np.h if found
Required for pthread_set_name_np() on OpenBSD as there is no
pthread_setaffinity_np() to define PTHREAD_SETAFFINITY_IN_NP_HEADER.
Fixes: dcf9d91a80e ("util: Handle differences in pthread_setname_np")
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
---
meson.build | 2 +-
src/util/u_thread.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index b79a378776a..be007953c8b 100644
--- a/meson.build
+++ b/meson.build
@@ -1206,7 +1206,7 @@ if not ['linux'].contains(host_machine.system())
endif
endif
-foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h']
+foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h', 'pthread_np.h']
if cc.check_header(h)
pre_args += '-DHAVE_ at 0@'.format(h.to_upper().underscorify())
endif
diff --git a/src/util/u_thread.h b/src/util/u_thread.h
index b91d05e4cfd..af44bcfc1bd 100644
--- a/src/util/u_thread.h
+++ b/src/util/u_thread.h
@@ -35,7 +35,7 @@
#ifdef HAVE_PTHREAD
#include <signal.h>
-#ifdef PTHREAD_SETAFFINITY_IN_NP_HEADER
+#ifdef HAVE_PTHREAD_NP_H
#include <pthread_np.h>
#endif
#endif
More information about the mesa-commit
mailing list