From 8cab7f570395ba07b732a935fc1c916d28f8b7ef Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Wed, 22 Jun 2011 16:20:37 -0400 Subject: [PATCH] sync: restore GOMAXPROCS during benchmarks R=golang-dev CC=dvyukov, golang-dev https://golang.org/cl/4631060 --- src/pkg/sync/mutex_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.50.0