Patchwork libgo patch committed: Non-futex system fix

login
register
mail settings
Submitter Ian Taylor
Date Dec. 6, 2013, 6:26 p.m.
Message ID <mcra9gdkf8r.fsf@iant-glaptop.roam.corp.google.com>
Download mbox | patch
Permalink /patch/298173/
State New
Headers show

Comments

Ian Taylor - Dec. 6, 2013, 6:26 p.m.
This patch to libgo fixes the scheduler in the current libgo for systems
that do not use futexes, such as Solaris.  I fixed the futex code a
while back, but I managed to forget to fix the non-futex code.  This is
PR 59408.  Committed to mainline.

Ian

Patch

diff -r cc2d51f8c87a libgo/runtime/lock_sema.c
--- a/libgo/runtime/lock_sema.c	Tue Dec 03 17:34:17 2013 -0800
+++ b/libgo/runtime/lock_sema.c	Fri Dec 06 10:23:12 2013 -0800
@@ -152,8 +152,12 @@ 
 
 	m = runtime_m();
 
+  /* For gccgo it's OK to sleep in non-g0, and it happens in
+     stoptheworld because we have not implemented preemption.
+
 	if(runtime_g() != m->g0)
 		runtime_throw("notesleep not on g0");
+  */
 
 	if(m->waitsema == 0)
 		m->waitsema = runtime_semacreate();