]> xenbits.xensource.com Git - rumpuser-xen.git/commitdiff
give all threads a chance to run before application runs
authorAntti Kantee <pooka@iki.fi>
Tue, 20 Jan 2015 15:19:01 +0000 (15:19 +0000)
committerAntti Kantee <pooka@iki.fi>
Tue, 20 Jan 2015 15:19:01 +0000 (15:19 +0000)
netbsd_init.c

index de0095788777777024f49aa1b528af1c1acf75e6..3833c3d87528ac8db97edd344301b9a9fdd5c87d 100644 (file)
@@ -3,6 +3,7 @@
 #include <sys/exec_elf.h>
 #include <sys/exec.h>
 
+#include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -47,6 +48,12 @@ _netbsd_init(void)
 #ifdef RUMP_SYSPROXY
        rump_init_server("tcp://0:12345");
 #endif
+
+       /*
+        * give all threads a chance to run, and ensure that the main
+        * thread has gone through a context switch
+        */
+       sched_yield();
 }
 
 void