fcami / rpms / mono

Forked from rpms/mono 3 years ago
Clone
7e2b69d
#! /bin/sh /usr/share/dpatch/dpatch-run
7e2b69d
## ppc-sched-affinity.dpatch by  <haleb@localhost.localdomain>
7e2b69d
##
7e2b69d
## All lines beginning with `## DP:' are a description of the patch.
7e2b69d
## DP: No description.
7e2b69d
7e2b69d
@DPATCH@
7e2b69d
diff -urNad mono-1.1.13.2~/mono/mini/main.c mono-1.1.13.2/mono/mini/main.c
7e2b69d
--- mono-1.1.13.2~/mono/mini/main.c	2004-12-10 19:01:25.000000000 -0500
7e2b69d
+++ mono-1.1.13.2/mono/mini/main.c	2006-02-16 12:04:28.000000000 -0500
7e2b69d
@@ -1,8 +1,15 @@
7e2b69d
 #include "mini.h"
7e2b69d
+#include <sched.h>
7e2b69d
 
7e2b69d
 int
7e2b69d
 main (int argc, char* argv[])
7e2b69d
 {
7e2b69d
+    /* On PowerPC call sched_setaffinity to bind to one CPU only
7e2b69d
+     * to work around parallelism bug on G5 SMP */
7e2b69d
+    #ifdef __powerpc__
7e2b69d
+    unsigned long mask = 1;
7e2b69d
+    sched_setaffinity(0, sizeof(mask), &mask);
7e2b69d
+    #endif
7e2b69d
 	return mono_main (argc, argv);
7e2b69d
 }
7e2b69d