mirror of
https://github.com/golang/go
synced 2024-11-21 16:44:43 -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:
parent
7cb21a79a4
commit
98af38807e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user