net: let OS-specific AddFD routine wake up polling thread.
With gccgo some operating systems require using select rather
than epoll or kevent. Using select means that we have to wake
up the polling thread each time we add a new file descriptor.
This implements that in the generic code rather than adding
another wakeup channel, even though nothing in the current net
package uses the capability.
R=rsc, iant2
CC=golang-dev
https://golang.org/cl/4284069
diff --git a/src/pkg/net/fd.go b/src/pkg/net/fd.go
index fa163eb..df4dbce 100644
--- a/src/pkg/net/fd.go
+++ b/src/pkg/net/fd.go
@@ -122,9 +122,13 @@
doWakeup = true
}
- if err := s.poll.AddFD(intfd, mode, false); err != nil {
+ wake, err := s.poll.AddFD(intfd, mode, false)
+ if err != nil {
panic("pollServer AddFD " + err.String())
}
+ if wake {
+ doWakeup = true
+ }
s.Unlock()