From: Dmitriy Vyukov Date: Wed, 22 Jun 2011 20:20:37 +0000 (-0400) Subject: sync: restore GOMAXPROCS during benchmarks X-Git-Tag: weekly.2011-06-23~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8cab7f570395ba07b732a935fc1c916d28f8b7ef;p=gostls13.git sync: restore GOMAXPROCS during benchmarks R=golang-dev CC=dvyukov, golang-dev https://golang.org/cl/4631060 --- diff --git a/src/pkg/sync/mutex_test.go b/src/pkg/sync/mutex_test.go index f5c20ca49b..9bfdec365f 100644 --- a/src/pkg/sync/mutex_test.go +++ b/src/pkg/sync/mutex_test.go @@ -43,7 +43,7 @@ func BenchmarkContendedSemaphore(b *testing.B) { s := new(uint32) *s = 1 c := make(chan bool) - runtime.GOMAXPROCS(2) + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) b.StartTimer() go HammerSemaphore(s, b.N/2, c) @@ -81,7 +81,7 @@ func BenchmarkContendedMutex(b *testing.B) { b.StopTimer() m := new(Mutex) c := make(chan bool) - runtime.GOMAXPROCS(2) + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) b.StartTimer() go HammerMutex(m, b.N/2, c)