mirror of
https://github.com/golang/go
synced 2024-11-25 09:57:57 -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 {
|
if dt < 1 {
|
||||||
dt = 1
|
dt = 1
|
||||||
}
|
}
|
||||||
ticker := time.NewTicker(time.Duration(dt) * time.Nanosecond)
|
timer := time.NewTimer(time.Duration(dt) * time.Nanosecond)
|
||||||
defer ticker.Stop()
|
defer timer.Stop()
|
||||||
select {
|
select {
|
||||||
case r = <-o.resultc:
|
case r = <-o.resultc:
|
||||||
case <-ticker.C:
|
case <-timer.C:
|
||||||
s.canchan <- oi
|
s.canchan <- oi
|
||||||
<-o.errnoc
|
<-o.errnoc
|
||||||
r = <-o.resultc
|
r = <-o.resultc
|
||||||
|
Loading…
Reference in New Issue
Block a user