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

rdp/rogerpack2005-golang,webfd/go-zh,scirelli/scirelli-go,scirelli/scirelli-go,bryanxu/go-zh,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,d0f/go-zh,mhennings/marcohennings-go,bryanxu/go-zh,sanjosh/sanjos100-tipc,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,d0f/go-zh,mhennings/marcohennings-go,scirelli/scirelli-go,scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,mhennings/marcohennings-go,d0f/go-zh,webfd/go-zh,rflanagan/reginaldflanagan-project1,rflanagan/reginaldflanagan-project1,sanjosh/sanjos100-tipc,d0f/go-zh,mhennings/marcohennings-go,rdp/rogerpack2005-golang,sanjosh/sanjos100-tipc,bryanxu/go-zh,scirelli/scirelli-go,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,sanjosh/sanjos100-tipc,mhennings/marcohennings-go,rflanagan/reginaldflanagan-project1,rdp/rogerpack2005-golang,webfd/go-zh,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,rflanagan/reginaldflanagan-project1,sanjosh/sanjos100-tipc,scirelli/scirelli-go,bryanxu/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,webfd/go-zh,d0f/go-zh,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,scirelli/scirelli-go,d0f/go-zh,rflanagan/reginaldflanagan-project1,bryanxu/go-zh,webfd/go-zh,rdp/rogerpack2005-golang,mhennings/marcohennings-go,webfd/go-zh,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,rflanagan/reginaldflanagan-project1,rflanagan/reginaldflanagan-project1,webfd/go-zh,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,bryanxu/go-zh,d0f/go-zh,rdp/rogerpack2005-golang