util/u_thread: include pthread_np.h if found
authorJonathan Gray <jsg@jsg.id.au>
Wed, 24 Jun 2020 13:27:52 +0000 (23:27 +1000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 09:14:57 +0000 (09:14 +0000)
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@jsg.id.au>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>

meson.build
src/util/u_thread.h

index b79a378776a1c165fcf1c2a77e8b17c557d56645..be007953c8b8597491e792219d070f9ef96bc091 100644 (file)
@@ -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_@0@'.format(h.to_upper().underscorify())
   endif
index b91d05e4cfd2aefa28cdb8e8aef9d25cdebbaec4..af44bcfc1bd6c0ab97b9ca27e146e49a8c4966f8 100644 (file)
@@ -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