runtime: convert netpoll to Go
The common code is converted, epoll and kqueue are converted.
Windows and solaris are still C.
LGTM=rsc
R=golang-codereviews, rsc, dave
CC=golang-codereviews, iant, khr, rsc
https://golang.org/cl/132910043
diff --git a/src/pkg/time/sleep.go b/src/pkg/time/sleep.go
index c7b019f..33c349d 100644
--- a/src/pkg/time/sleep.go
+++ b/src/pkg/time/sleep.go
@@ -17,8 +17,9 @@
i int
when int64
period int64
- f func(interface{}) // NOTE: must not be closure
+ f func(interface{}, uintptr) // NOTE: must not be closure
arg interface{}
+ seq uintptr
}
// when is a helper function for setting the 'when' field of a runtimeTimer.
@@ -83,7 +84,7 @@
return active
}
-func sendTime(c interface{}) {
+func sendTime(c interface{}, seq uintptr) {
// Non-blocking send of time on c.
// Used in NewTimer, it cannot block anyway (buffer).
// Used in NewTicker, dropping sends on the floor is
@@ -117,6 +118,6 @@
return t
}
-func goFunc(arg interface{}) {
+func goFunc(arg interface{}, seq uintptr) {
go arg.(func())()
}