From: Dmitriy Vyukov Date: Tue, 30 Jul 2013 18:17:38 +0000 (+0400) Subject: runtime: enable goroutine preemption X-Git-Tag: go1.2rc2~889 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a20784bdafc9a594a2c70be1e91f4b86182e6a21;p=gostls13.git runtime: enable goroutine preemption All known issues with preemption have beed fixed. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/12008044 --- diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 0f44f6b981..c4b8c02517 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -2266,7 +2266,7 @@ preemptone(P *p) // For now, disable. // The if(1) silences a compiler warning about the rest of the // function being unreachable. -if(1) return; +if(0) return; mp = p->m; if(mp == nil || mp == m) diff --git a/src/pkg/runtime/proc_test.go b/src/pkg/runtime/proc_test.go index 100deb8f23..8f47553fb4 100644 --- a/src/pkg/runtime/proc_test.go +++ b/src/pkg/runtime/proc_test.go @@ -193,7 +193,6 @@ var preempt = func() int { } func TestPreemption(t *testing.T) { - t.Skip("preemption is disabled") // Test that goroutines are preempted at function calls. const N = 5 c := make(chan bool) @@ -214,7 +213,6 @@ func TestPreemption(t *testing.T) { } func TestPreemptionGC(t *testing.T) { - t.Skip("preemption is disabled") // Test that pending GC preempts running goroutines. const P = 5 defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(P + 1))