]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: enable goroutine preemption
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 30 Jul 2013 18:17:38 +0000 (22:17 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 30 Jul 2013 18:17:38 +0000 (22:17 +0400)
All known issues with preemption have beed fixed.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12008044

src/pkg/runtime/proc.c
src/pkg/runtime/proc_test.go

index 0f44f6b9819f47b8136499073eb9a343c48bf205..c4b8c025173b26a3dfdfa3758a8ca4328f336148 100644 (file)
@@ -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)
index 100deb8f238a9e203dd20fd2812b742c1d0e0cce..8f47553fb4724db3a84055f210a82dde07d81378 100644 (file)
@@ -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))