runtime: correct test for when to poll network
Fixes #6610. R=golang-dev, khr CC=golang-dev https://golang.org/cl/14793043
This commit is contained in:
parent
667303f158
commit
88c448ba40
@ -2382,7 +2382,7 @@ sysmon(void)
|
|||||||
// poll network if not polled for more than 10ms
|
// poll network if not polled for more than 10ms
|
||||||
lastpoll = runtime·atomicload64(&runtime·sched.lastpoll);
|
lastpoll = runtime·atomicload64(&runtime·sched.lastpoll);
|
||||||
now = runtime·nanotime();
|
now = runtime·nanotime();
|
||||||
if(lastpoll != 0 && lastpoll + 10*1000*1000 > now) {
|
if(lastpoll != 0 && lastpoll + 10*1000*1000 < now) {
|
||||||
runtime·cas64(&runtime·sched.lastpoll, lastpoll, now);
|
runtime·cas64(&runtime·sched.lastpoll, lastpoll, now);
|
||||||
gp = runtime·netpoll(false); // non-blocking
|
gp = runtime·netpoll(false); // non-blocking
|
||||||
if(gp) {
|
if(gp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user