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 issue 3954.
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 issue 3954.

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6820098

wesolows/golang,wesolows/golang-old,wesolows/golang-old,wesolows/golang,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang,firebitsbr/golang-old,wesolows/golang-old,firebitsbr/golang-old,wesolows/golang,wesolows/golang-old,firebitsbr/golang-old,firebitsbr/golang-old,wesolows/golang-old,wesolows/golang,wesolows/golang-old,wesolows/golang