diff options
Diffstat (limited to 'src/pkg/time/tick.go')
| -rw-r--r-- | src/pkg/time/tick.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/time/tick.go b/src/pkg/time/tick.go index 81c385220..47ee84fc7 100644 --- a/src/pkg/time/tick.go +++ b/src/pkg/time/tick.go @@ -25,7 +25,6 @@ import ( // } func ticker(ns int64, c chan int64) { - var tv syscall.Timeval; now := Nanoseconds(); when := now; for { @@ -44,6 +43,9 @@ func ticker(ns int64, c chan int64) { Sleep(when - now); now = Nanoseconds(); c <- now; + if closed(c) { + return; + } } } |
