Module: Mesa
Branch: staging/20.1
Commit: f360a57772e6757db32eb6dd67484f848296334f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f360a57772e6757db32eb6dd67484f848296334f

Author: Jonathan Gray <j...@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 <j...@jsg.id.au>
Reviewed-by: Eric Engestrom <e...@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
(cherry picked from commit 55765f80b9ce7cce4ec6a1c2bed6476776d9cbed)

---

 .pick_status.json   | 2 +-
 meson.build         | 2 +-
 src/util/u_thread.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 46db8eb42f6..b4226450cbd 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -760,7 +760,7 @@
         "description": "util/u_thread: include pthread_np.h if found",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "dcf9d91a80ee76f46e162afef9bd1b2ddb53ecc3"
     },
diff --git a/meson.build b/meson.build
index 1aaea469635..61ab4ef32ba 100644
--- a/meson.build
+++ b/meson.build
@@ -1161,7 +1161,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.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
     pre_args += '-DHAVE_@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

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to