• Dmitriy Vyukov's avatar
    runtime: fix deadlock in parallel for test · 6ae448e8
    Dmitriy Vyukov authored
    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
    6ae448e8
parfor_test.go 2.94 KB