mirror of
https://github.com/golang/go
synced 2024-11-22 09:34:54 -07:00
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
This commit is contained in:
parent
60b9cd535c
commit
e0aa26a427
@ -54,9 +54,10 @@ 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()
|
||||
// Yield so that the OS can wake up the timer thread,
|
||||
// so that it can generate channel sends for the main goroutine,
|
||||
// which will eventually set stop = 1 for us.
|
||||
Sleep(Nanosecond)
|
||||
}
|
||||
}()
|
||||
c := Tick(1)
|
||||
|
Loading…
Reference in New Issue
Block a user