Commit e0aa26a4 authored by Alex Brainman's avatar Alex Brainman

time: Sleep does better job then runtime.Gosched in TestAfterStress

for slow windows-386 builder

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7128053
parent 60b9cd53
...@@ -54,9 +54,10 @@ func TestAfterStress(t *testing.T) { ...@@ -54,9 +54,10 @@ func TestAfterStress(t *testing.T) {
go func() { go func() {
for atomic.LoadUint32(&stop) == 0 { for atomic.LoadUint32(&stop) == 0 {
runtime.GC() runtime.GC()
// Need to yield, because otherwise // Yield so that the OS can wake up the timer thread,
// the main goroutine will never set the stop flag. // so that it can generate channel sends for the main goroutine,
runtime.Gosched() // which will eventually set stop = 1 for us.
Sleep(Nanosecond)
} }
}() }()
c := Tick(1) c := Tick(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment