]> Cypherpunks repositories - gostls13.git/commit
runtime: fix race in BenchmarkPingPongHog
authorRuss Cox <rsc@golang.org>
Mon, 27 Apr 2015 20:08:11 +0000 (16:08 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 27 Apr 2015 20:10:11 +0000 (20:10 +0000)
commit42da27002428ed27f9aeee5800120e2222c226a0
treeef4dcb4418ec5afb0eff13891fc30e3bbb69415f
parent33e0f3d853f871d849cd8e3b30a31b91d00bb209
runtime: fix race in BenchmarkPingPongHog

The master goroutine was returning before
the child goroutine had done its final i < b.N
(the one that fails and causes it to exit the loop)
and then the benchmark harness was updating
b.N, causing a read+write race on b.N.

Change-Id: I2504270a0de30544736f6c32161337a25b505c3e
Reviewed-on: https://go-review.googlesource.com/9368
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/proc_test.go