]> Cypherpunks repositories - gostls13.git/commit
runtime: fix deadlock in parallel for test
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Nov 2012 16:11:16 +0000 (20:11 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 6 Nov 2012 16:11:16 +0000 (20:11 +0400)
commit6ae448e8dfc675c0fbda18e2b555af54ae656f69
tree641b103cd374ae7c5da032545a0e25fbd2216606
parentd6b9a03b7f6f158c470405e2e4d6a68dcd094a95
runtime: fix deadlock in parallel for test
The deadlock occurs when another goroutine requests GC
during the test. When wait=true the test expects physical parallelism,
that is, that P goroutines are all active at the same time.
If GC is requested, then part of the goroutines are not scheduled,
so other goroutines deadlock.
With wait=false, goroutines finish parallel for w/o waiting for all
other goroutines.
Fixes #3954.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6820098
src/pkg/runtime/parfor_test.go