]> Cypherpunks repositories - gostls13.git/commitdiff
test: enforce 1 proc in the test
authorDmitriy Vyukov <dvyukov@google.com>
Sun, 1 Jul 2012 17:59:50 +0000 (21:59 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Sun, 1 Jul 2012 17:59:50 +0000 (21:59 +0400)
otherwise it fails spuriously with "newfunc allocated unexpectedly" message
when run with GOMAXPROCS>1 (other goroutine allocates).

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6347056

test/closure.go

index ae38900baaf96715a5851987ae88aac97483fffb..c4a312464bcf4e130143941e67421b1a1615fa94 100644 (file)
@@ -81,6 +81,7 @@ func h() {
 func newfunc() func(int) int { return func(x int) int { return x } }
 
 func main() {
+       runtime.GOMAXPROCS(1)
        var fail bool
 
        go f()