1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:24:39 -07:00

time: fix test hang

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5374083
This commit is contained in:
Dmitriy Vyukov 2011-11-14 22:31:39 +03:00
parent 3811a44103
commit ba98a7ee5e

View File

@ -54,6 +54,9 @@ func TestAfterStress(t *testing.T) {
go func() {
for atomic.LoadUint32(&stop) == 0 {
runtime.GC()
// Need to yield, because otherwise
// the main goroutine will never set the stop flag.
runtime.Gosched()
}
}()
c := Tick(1)