diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go index 36b9edfe21..8d65a81edc 100644 --- a/src/runtime/netpoll.go +++ b/src/runtime/netpoll.go @@ -31,7 +31,7 @@ import ( // poll without blocking. If delta > 0, block for up to delta nanoseconds. // Return a list of goroutines built by calling netpollready, // and a delta to add to netpollWaiters when all goroutines are ready. -// This will never return an empty list with a non-zero delta. +// This must never return an empty list with a non-zero delta. // // func netpollBreak() // Wake up the network poller, assumed to be blocked in netpoll. diff --git a/src/runtime/netpoll_aix.go b/src/runtime/netpoll_aix.go index 2df5a57111..4cf34d1c61 100644 --- a/src/runtime/netpoll_aix.go +++ b/src/runtime/netpoll_aix.go @@ -148,7 +148,10 @@ func netpollBreak() { } // netpoll checks for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. +// // delay < 0: blocks indefinitely // delay == 0: does not block, just polls // delay > 0: block for up to that many nanoseconds diff --git a/src/runtime/netpoll_epoll.go b/src/runtime/netpoll_epoll.go index ff6e0b5f89..c43bab0882 100644 --- a/src/runtime/netpoll_epoll.go +++ b/src/runtime/netpoll_epoll.go @@ -89,7 +89,10 @@ func netpollBreak() { } // netpoll checks for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. +// // delay < 0: blocks indefinitely // delay == 0: does not block, just polls // delay > 0: block for up to that many nanoseconds diff --git a/src/runtime/netpoll_kqueue.go b/src/runtime/netpoll_kqueue.go index 6cd80d5c30..ca7898205e 100644 --- a/src/runtime/netpoll_kqueue.go +++ b/src/runtime/netpoll_kqueue.go @@ -80,7 +80,10 @@ func netpollBreak() { } // netpoll checks for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. +// // delay < 0: blocks indefinitely // delay == 0: does not block, just polls // delay > 0: block for up to that many nanoseconds diff --git a/src/runtime/netpoll_solaris.go b/src/runtime/netpoll_solaris.go index fddc29000b..90459c08df 100644 --- a/src/runtime/netpoll_solaris.go +++ b/src/runtime/netpoll_solaris.go @@ -215,7 +215,10 @@ func netpollBreak() { } // netpoll checks for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. +// // delay < 0: blocks indefinitely // delay == 0: does not block, just polls // delay > 0: block for up to that many nanoseconds diff --git a/src/runtime/netpoll_stub.go b/src/runtime/netpoll_stub.go index c1bda3fa8b..dc5d708b4c 100644 --- a/src/runtime/netpoll_stub.go +++ b/src/runtime/netpoll_stub.go @@ -32,7 +32,9 @@ func netpollBreak() { } // Polls for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. func netpoll(delay int64) (gList, int32) { // Implementation for platforms that do not support // integrated network poller. diff --git a/src/runtime/netpoll_windows.go b/src/runtime/netpoll_windows.go index c3c10af723..fb35d41c0c 100644 --- a/src/runtime/netpoll_windows.go +++ b/src/runtime/netpoll_windows.go @@ -144,7 +144,10 @@ func netpollBreak() { } // netpoll checks for ready network connections. -// Returns list of goroutines that become runnable. +// Returns a list of goroutines that become runnable, +// and a delta to add to netpollWaiters. +// This must never return an empty list with a non-zero delta. +// // delay < 0: blocks indefinitely // delay == 0: does not block, just polls // delay > 0: block for up to that many nanoseconds