1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:24:45 -07:00

net: use NewTimer, not NewTicker, in fd_windows.go

It works with NewTicker too, but is potentially a bit less efficient,
and reads wrong.

This is what happens when you TBR Windows changes, I guess.

R=golang-dev, gri, iant
CC=golang-dev
https://golang.org/cl/5536060
This commit is contained in:
Brad Fitzpatrick 2012-01-18 16:49:59 -08:00
parent 7cb21a79a4
commit 98af38807e

View File

@ -179,11 +179,11 @@ func (s *ioSrv) ExecIO(oi anOpIface, deadline int64) (n int, err error) {
if dt < 1 {
dt = 1
}
ticker := time.NewTicker(time.Duration(dt) * time.Nanosecond)
defer ticker.Stop()
timer := time.NewTimer(time.Duration(dt) * time.Nanosecond)
defer timer.Stop()
select {
case r = <-o.resultc:
case <-ticker.C:
case <-timer.C:
s.canchan <- oi
<-o.errnoc
r = <-o.resultc