summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-user/syscall.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8e69c151f..82195a2b0 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6010,6 +6010,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp,
if (nptl_flags & CLONE_SETTLS)
cpu_set_tls (new_env, newtls);
+ /* agraf: Pin ourselves to a single CPU when running multi-threaded.
+ This turned out to improve stability for me. */
+ {
+ cpu_set_t mask;
+ CPU_ZERO(&mask);
+ CPU_SET(0, &mask);
+ sched_setaffinity(0, sizeof(mask), &mask);
+ }
+
/* Grab a mutex so that thread setup appears atomic. */
pthread_mutex_lock(&clone_lock);