diff options
Diffstat (limited to 'graphics/MesaLib/patches/patch-src_util_u__queue.c')
-rw-r--r-- | graphics/MesaLib/patches/patch-src_util_u__queue.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/graphics/MesaLib/patches/patch-src_util_u__queue.c b/graphics/MesaLib/patches/patch-src_util_u__queue.c index 68d8f2f09e0..efaacbebace 100644 --- a/graphics/MesaLib/patches/patch-src_util_u__queue.c +++ b/graphics/MesaLib/patches/patch-src_util_u__queue.c @@ -1,13 +1,13 @@ -$NetBSD: patch-src_util_u__queue.c,v 1.2 2020/03/08 10:35:03 tnn Exp $ +$NetBSD: patch-src_util_u__queue.c,v 1.3 2022/03/13 15:50:05 tnn Exp $ atexit() is not a good idea in shared libraries. FreeBSD reported atexit bug for 10.6: https://bugs.freedesktop.org/show_bug.cgi?id=91869 ---- src/util/u_queue.c.orig 2020-03-05 21:34:32.000000000 +0000 +--- src/util/u_queue.c.orig 2021-07-14 20:04:59.260044300 +0000 +++ src/util/u_queue.c -@@ -51,11 +51,22 @@ static once_flag atexit_once_flag = ONCE +@@ -58,11 +58,22 @@ static once_flag atexit_once_flag = ONCE static struct list_head queue_list; static mtx_t exit_mutex = _MTX_INITIALIZER_NP; @@ -30,7 +30,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869 mtx_lock(&exit_mutex); /* Wait for all queues to assert idle. */ LIST_FOR_EACH_ENTRY(iter, &queue_list, head) { -@@ -68,7 +79,11 @@ static void +@@ -75,7 +86,11 @@ static void global_init(void) { list_inithead(&queue_list); @@ -42,29 +42,3 @@ https://bugs.freedesktop.org/show_bug.cgi?id=91869 } static void -@@ -249,12 +264,25 @@ util_queue_thread_func(void *input) - /* Don't inherit the thread affinity from the parent thread. - * Set the full mask. - */ -+#if defined(__NetBSD__) -+ cpuset_t *cpuset; -+ cpuset = cpuset_create(); -+ if (cpuset != NULL) { -+ cpuset_zero(cpuset); -+ for (unsigned i = 0; i < cpuset_size(cpuset); i++) -+ cpuset_set(i, cpuset); -+ -+ pthread_setaffinity_np(pthread_self(), cpuset_size(cpuset), cpuset); -+ cpuset_destroy(cpuset); -+ } -+#else - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - for (unsigned i = 0; i < CPU_SETSIZE; i++) - CPU_SET(i, &cpuset); - - pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset); -+#endif - } - #endif - |