mirror of https://github.com/golang/go.git
net: move system common global variables into fd_unix.go
R=golang-dev, bradfitz CC=dvyukov, golang-dev, mikioh.mikioh https://golang.org/cl/9495044
This commit is contained in:
parent
1308194204
commit
1a948950f7
|
|
@ -20,17 +20,12 @@ func runtime_pollReset(ctx uintptr, mode int) int
|
|||
func runtime_pollSetDeadline(ctx uintptr, d int64, mode int)
|
||||
func runtime_pollUnblock(ctx uintptr)
|
||||
|
||||
var canCancelIO = true // used for testing current package
|
||||
|
||||
type pollDesc struct {
|
||||
runtimeCtx uintptr
|
||||
}
|
||||
|
||||
var serverInit sync.Once
|
||||
|
||||
func sysInit() {
|
||||
}
|
||||
|
||||
func (pd *pollDesc) Init(fd *netFD) error {
|
||||
serverInit.Do(runtime_pollServerInit)
|
||||
ctx, errno := runtime_pollOpen(uintptr(fd.sysfd))
|
||||
|
|
|
|||
|
|
@ -303,9 +303,7 @@ var pollMaxN int
|
|||
var pollservers []*pollServer
|
||||
var startServersOnce []func()
|
||||
|
||||
var canCancelIO = true // used for testing current package
|
||||
|
||||
func sysInit() {
|
||||
func init() {
|
||||
pollMaxN = runtime.NumCPU()
|
||||
if pollMaxN > 8 {
|
||||
pollMaxN = 8 // No improvement then.
|
||||
|
|
|
|||
|
|
@ -41,6 +41,11 @@ type netFD struct {
|
|||
pd pollDesc
|
||||
}
|
||||
|
||||
var canCancelIO = true // used for testing current package
|
||||
|
||||
func sysInit() {
|
||||
}
|
||||
|
||||
func resolveAndDial(net, addr string, localAddr Addr, deadline time.Time) (Conn, error) {
|
||||
ra, err := resolveAddr("dial", net, addr, deadline)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue