summaryrefslogtreecommitdiff
path: root/test/closure.go
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2012-07-01 21:59:50 +0400
committerDmitriy Vyukov <dvyukov@google.com>2012-07-01 21:59:50 +0400
commit5e8c05d0b042ca5ccde2bb5a33f368e829270470 (patch)
tree04a0dbb097d0b1fadcd1da5851569d5aba3d9f1d /test/closure.go
parent575011efed510157d92656c1087594aa3a0fd47b (diff)
downloadgo-5e8c05d0b042ca5ccde2bb5a33f368e829270470.tar.gz
test: enforce 1 proc in the test
otherwise it fails spuriously with "newfunc allocated unexpectedly" message when run with GOMAXPROCS>1 (other goroutine allocates). R=golang-dev, dsymonds CC=golang-dev http://codereview.appspot.com/6347056
Diffstat (limited to 'test/closure.go')
-rw-r--r--test/closure.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/closure.go b/test/closure.go
index ae38900ba..c4a312464 100644
--- a/test/closure.go
+++ b/test/closure.go
@@ -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()