Commit 8cab7f57 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov Committed by Russ Cox

sync: restore GOMAXPROCS during benchmarks

R=golang-dev
CC=dvyukov, golang-dev
https://golang.org/cl/4631060
parent 89d334ff
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment