diff --git a/src/runtime/time.go b/src/runtime/time.go index 75b66f8492..83d93c5686 100644 --- a/src/runtime/time.go +++ b/src/runtime/time.go @@ -23,6 +23,8 @@ type timer struct { // Timer wakes up at when, and then at when+period, ... (period > 0 only) // each time calling f(arg, now) in the timer goroutine, so f must be // a well-behaved function and not block. + // + // when must be positive on an active timer. when int64 period int64 f func(interface{}, uintptr) diff --git a/src/time/internal_test.go b/src/time/internal_test.go index 35ce69b228..e70b6f34de 100644 --- a/src/time/internal_test.go +++ b/src/time/internal_test.go @@ -53,18 +53,8 @@ func CheckRuntimeTimerOverflow() { t := NewTimer(1) defer func() { - // Subsequent tests won't work correctly if we don't stop the - // overflow timer and kick the timer proc back into service. - // - // The timer proc is now sleeping and can only be awoken by - // adding a timer to the *beginning* of the heap. We can't - // wake it up by calling NewTimer since other tests may have - // left timers running that should have expired before ours. - // Instead we zero the overflow timer duration and start it - // once more. stopTimer(r) t.Stop() - resetTimer(r, 0) }() // If the test fails, we will hang here until the timeout in the