net: make unexposed methods start with lowercase letters
This change makes unexposed methods start with lowercase letters for
avoiding unnecessary confusion because the net package uses many
embedding structures and intrefaces for controlling exposure of APIs.
Note that this change leaves DNS-related methods as they are.
Change-Id: I253758d1659175c5d0af6b2efcd30ce83f46543d
Reviewed-on: https://go-review.googlesource.com/20784
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/net/fd_mutex.go b/src/net/fd_mutex.go
index 6d5509d..83ebb27 100644
--- a/src/net/fd_mutex.go
+++ b/src/net/fd_mutex.go
@@ -34,18 +34,18 @@
mutexWMask = (1<<20 - 1) << 43
)
-// Read operations must do RWLock(true)/RWUnlock(true).
-// Write operations must do RWLock(false)/RWUnlock(false).
-// Misc operations must do Incref/Decref. Misc operations include functions like
-// setsockopt and setDeadline. They need to use Incref/Decref to ensure that
-// they operate on the correct fd in presence of a concurrent Close call
+// Read operations must do rwlock(true)/rwunlock(true).
+// Write operations must do rwlock(false)/rwunlock(false).
+// Misc operations must do incref/decref. Misc operations include functions like
+// setsockopt and setDeadline. They need to use incref/decref to ensure that
+// they operate on the correct fd in presence of a concurrent close call
// (otherwise fd can be closed under their feet).
-// Close operation must do IncrefAndClose/Decref.
+// Close operation must do increfAndClose/decref.
-// RWLock/Incref return whether fd is open.
-// RWUnlock/Decref return whether fd is closed and there are no remaining references.
+// rwlock/incref return whether fd is open.
+// rwunlock/decref return whether fd is closed and there are no remaining references.
-func (mu *fdMutex) Incref() bool {
+func (mu *fdMutex) incref() bool {
for {
old := atomic.LoadUint64(&mu.state)
if old&mutexClosed != 0 {
@@ -61,7 +61,7 @@
}
}
-func (mu *fdMutex) IncrefAndClose() bool {
+func (mu *fdMutex) increfAndClose() bool {
for {
old := atomic.LoadUint64(&mu.state)
if old&mutexClosed != 0 {
@@ -90,7 +90,7 @@
}
}
-func (mu *fdMutex) Decref() bool {
+func (mu *fdMutex) decref() bool {
for {
old := atomic.LoadUint64(&mu.state)
if old&mutexRefMask == 0 {
@@ -103,7 +103,7 @@
}
}
-func (mu *fdMutex) RWLock(read bool) bool {
+func (mu *fdMutex) rwlock(read bool) bool {
var mutexBit, mutexWait, mutexMask uint64
var mutexSema *uint32
if read {
@@ -146,7 +146,7 @@
}
}
-func (mu *fdMutex) RWUnlock(read bool) bool {
+func (mu *fdMutex) rwunlock(read bool) bool {
var mutexBit, mutexWait, mutexMask uint64
var mutexSema *uint32
if read {
diff --git a/src/net/fd_mutex_test.go b/src/net/fd_mutex_test.go
index c34ec59..3542c70 100644
--- a/src/net/fd_mutex_test.go
+++ b/src/net/fd_mutex_test.go
@@ -14,44 +14,44 @@
func TestMutexLock(t *testing.T) {
var mu fdMutex
- if !mu.Incref() {
+ if !mu.incref() {
t.Fatal("broken")
}
- if mu.Decref() {
+ if mu.decref() {
t.Fatal("broken")
}
- if !mu.RWLock(true) {
+ if !mu.rwlock(true) {
t.Fatal("broken")
}
- if mu.RWUnlock(true) {
+ if mu.rwunlock(true) {
t.Fatal("broken")
}
- if !mu.RWLock(false) {
+ if !mu.rwlock(false) {
t.Fatal("broken")
}
- if mu.RWUnlock(false) {
+ if mu.rwunlock(false) {
t.Fatal("broken")
}
}
func TestMutexClose(t *testing.T) {
var mu fdMutex
- if !mu.IncrefAndClose() {
+ if !mu.increfAndClose() {
t.Fatal("broken")
}
- if mu.Incref() {
+ if mu.incref() {
t.Fatal("broken")
}
- if mu.RWLock(true) {
+ if mu.rwlock(true) {
t.Fatal("broken")
}
- if mu.RWLock(false) {
+ if mu.rwlock(false) {
t.Fatal("broken")
}
- if mu.IncrefAndClose() {
+ if mu.increfAndClose() {
t.Fatal("broken")
}
}
@@ -59,10 +59,10 @@
func TestMutexCloseUnblock(t *testing.T) {
c := make(chan bool)
var mu fdMutex
- mu.RWLock(true)
+ mu.rwlock(true)
for i := 0; i < 4; i++ {
go func() {
- if mu.RWLock(true) {
+ if mu.rwlock(true) {
t.Error("broken")
return
}
@@ -76,7 +76,7 @@
t.Fatal("broken")
default:
}
- mu.IncrefAndClose() // Must unblock the readers.
+ mu.increfAndClose() // Must unblock the readers.
for i := 0; i < 4; i++ {
select {
case <-c:
@@ -84,10 +84,10 @@
t.Fatal("broken")
}
}
- if mu.Decref() {
+ if mu.decref() {
t.Fatal("broken")
}
- if !mu.RWUnlock(true) {
+ if !mu.rwunlock(true) {
t.Fatal("broken")
}
}
@@ -103,21 +103,21 @@
}
var mu fdMutex
- ensurePanics(func() { mu.Decref() })
- ensurePanics(func() { mu.RWUnlock(true) })
- ensurePanics(func() { mu.RWUnlock(false) })
+ ensurePanics(func() { mu.decref() })
+ ensurePanics(func() { mu.rwunlock(true) })
+ ensurePanics(func() { mu.rwunlock(false) })
- ensurePanics(func() { mu.Incref(); mu.Decref(); mu.Decref() })
- ensurePanics(func() { mu.RWLock(true); mu.RWUnlock(true); mu.RWUnlock(true) })
- ensurePanics(func() { mu.RWLock(false); mu.RWUnlock(false); mu.RWUnlock(false) })
+ ensurePanics(func() { mu.incref(); mu.decref(); mu.decref() })
+ ensurePanics(func() { mu.rwlock(true); mu.rwunlock(true); mu.rwunlock(true) })
+ ensurePanics(func() { mu.rwlock(false); mu.rwunlock(false); mu.rwunlock(false) })
// ensure that it's still not broken
- mu.Incref()
- mu.Decref()
- mu.RWLock(true)
- mu.RWUnlock(true)
- mu.RWLock(false)
- mu.RWUnlock(false)
+ mu.incref()
+ mu.decref()
+ mu.rwlock(true)
+ mu.rwunlock(true)
+ mu.rwlock(false)
+ mu.rwunlock(false)
}
func TestMutexStress(t *testing.T) {
@@ -138,16 +138,16 @@
for i := 0; i < N; i++ {
switch r.Intn(3) {
case 0:
- if !mu.Incref() {
+ if !mu.incref() {
t.Error("broken")
return
}
- if mu.Decref() {
+ if mu.decref() {
t.Error("broken")
return
}
case 1:
- if !mu.RWLock(true) {
+ if !mu.rwlock(true) {
t.Error("broken")
return
}
@@ -158,12 +158,12 @@
}
readState[0]++
readState[1]++
- if mu.RWUnlock(true) {
+ if mu.rwunlock(true) {
t.Error("broken")
return
}
case 2:
- if !mu.RWLock(false) {
+ if !mu.rwlock(false) {
t.Error("broken")
return
}
@@ -174,7 +174,7 @@
}
writeState[0]++
writeState[1]++
- if mu.RWUnlock(false) {
+ if mu.rwunlock(false) {
t.Error("broken")
return
}
@@ -186,10 +186,10 @@
for p := 0; p < P; p++ {
<-done
}
- if !mu.IncrefAndClose() {
+ if !mu.increfAndClose() {
t.Fatal("broken")
}
- if !mu.Decref() {
+ if !mu.decref() {
t.Fatal("broken")
}
}
diff --git a/src/net/fd_plan9.go b/src/net/fd_plan9.go
index 1a791c0..577f2b6 100644
--- a/src/net/fd_plan9.go
+++ b/src/net/fd_plan9.go
@@ -77,7 +77,7 @@
// Add a reference to this fd.
// Returns an error if the fd cannot be used.
func (fd *netFD) incref() error {
- if !fd.fdmu.Incref() {
+ if !fd.fdmu.incref() {
return errClosing
}
return nil
@@ -86,7 +86,7 @@
// Remove a reference to this FD and close if we've been asked to do so
// (and there are no references left).
func (fd *netFD) decref() {
- if fd.fdmu.Decref() {
+ if fd.fdmu.decref() {
fd.destroy()
}
}
@@ -94,7 +94,7 @@
// Add a reference to this fd and lock for reading.
// Returns an error if the fd cannot be used.
func (fd *netFD) readLock() error {
- if !fd.fdmu.RWLock(true) {
+ if !fd.fdmu.rwlock(true) {
return errClosing
}
return nil
@@ -102,7 +102,7 @@
// Unlock for reading and remove a reference to this FD.
func (fd *netFD) readUnlock() {
- if fd.fdmu.RWUnlock(true) {
+ if fd.fdmu.rwunlock(true) {
fd.destroy()
}
}
@@ -110,7 +110,7 @@
// Add a reference to this fd and lock for writing.
// Returns an error if the fd cannot be used.
func (fd *netFD) writeLock() error {
- if !fd.fdmu.RWLock(false) {
+ if !fd.fdmu.rwlock(false) {
return errClosing
}
return nil
@@ -118,7 +118,7 @@
// Unlock for writing and remove a reference to this FD.
func (fd *netFD) writeUnlock() {
- if fd.fdmu.RWUnlock(false) {
+ if fd.fdmu.rwunlock(false) {
fd.destroy()
}
}
@@ -165,7 +165,7 @@
}
func (fd *netFD) Close() error {
- if !fd.fdmu.IncrefAndClose() {
+ if !fd.fdmu.increfAndClose() {
return errClosing
}
if !fd.ok() {
diff --git a/src/net/fd_poll_nacl.go b/src/net/fd_poll_nacl.go
index 1025a59..cda8b82 100644
--- a/src/net/fd_poll_nacl.go
+++ b/src/net/fd_poll_nacl.go
@@ -14,44 +14,44 @@
closing bool
}
-func (pd *pollDesc) Init(fd *netFD) error { pd.fd = fd; return nil }
+func (pd *pollDesc) init(fd *netFD) error { pd.fd = fd; return nil }
-func (pd *pollDesc) Close() {}
+func (pd *pollDesc) close() {}
-func (pd *pollDesc) Evict() {
+func (pd *pollDesc) evict() {
pd.closing = true
if pd.fd != nil {
syscall.StopIO(pd.fd.sysfd)
}
}
-func (pd *pollDesc) Prepare(mode int) error {
+func (pd *pollDesc) prepare(mode int) error {
if pd.closing {
return errClosing
}
return nil
}
-func (pd *pollDesc) PrepareRead() error { return pd.Prepare('r') }
+func (pd *pollDesc) prepareRead() error { return pd.prepare('r') }
-func (pd *pollDesc) PrepareWrite() error { return pd.Prepare('w') }
+func (pd *pollDesc) prepareWrite() error { return pd.prepare('w') }
-func (pd *pollDesc) Wait(mode int) error {
+func (pd *pollDesc) wait(mode int) error {
if pd.closing {
return errClosing
}
return errTimeout
}
-func (pd *pollDesc) WaitRead() error { return pd.Wait('r') }
+func (pd *pollDesc) waitRead() error { return pd.wait('r') }
-func (pd *pollDesc) WaitWrite() error { return pd.Wait('w') }
+func (pd *pollDesc) waitWrite() error { return pd.wait('w') }
-func (pd *pollDesc) WaitCanceled(mode int) {}
+func (pd *pollDesc) waitCanceled(mode int) {}
-func (pd *pollDesc) WaitCanceledRead() {}
+func (pd *pollDesc) waitCanceledRead() {}
-func (pd *pollDesc) WaitCanceledWrite() {}
+func (pd *pollDesc) waitCanceledWrite() {}
func (fd *netFD) setDeadline(t time.Time) error {
return setDeadlineImpl(fd, t, 'r'+'w')
diff --git a/src/net/fd_poll_runtime.go b/src/net/fd_poll_runtime.go
index 5897e3d6..6c1d095 100644
--- a/src/net/fd_poll_runtime.go
+++ b/src/net/fd_poll_runtime.go
@@ -30,7 +30,7 @@
var serverInit sync.Once
-func (pd *pollDesc) Init(fd *netFD) error {
+func (pd *pollDesc) init(fd *netFD) error {
serverInit.Do(runtime_pollServerInit)
ctx, errno := runtime_pollOpen(uintptr(fd.sysfd))
if errno != 0 {
@@ -40,7 +40,7 @@
return nil
}
-func (pd *pollDesc) Close() {
+func (pd *pollDesc) close() {
if pd.runtimeCtx == 0 {
return
}
@@ -49,49 +49,49 @@
}
// Evict evicts fd from the pending list, unblocking any I/O running on fd.
-func (pd *pollDesc) Evict() {
+func (pd *pollDesc) evict() {
if pd.runtimeCtx == 0 {
return
}
runtime_pollUnblock(pd.runtimeCtx)
}
-func (pd *pollDesc) Prepare(mode int) error {
+func (pd *pollDesc) prepare(mode int) error {
res := runtime_pollReset(pd.runtimeCtx, mode)
return convertErr(res)
}
-func (pd *pollDesc) PrepareRead() error {
- return pd.Prepare('r')
+func (pd *pollDesc) prepareRead() error {
+ return pd.prepare('r')
}
-func (pd *pollDesc) PrepareWrite() error {
- return pd.Prepare('w')
+func (pd *pollDesc) prepareWrite() error {
+ return pd.prepare('w')
}
-func (pd *pollDesc) Wait(mode int) error {
+func (pd *pollDesc) wait(mode int) error {
res := runtime_pollWait(pd.runtimeCtx, mode)
return convertErr(res)
}
-func (pd *pollDesc) WaitRead() error {
- return pd.Wait('r')
+func (pd *pollDesc) waitRead() error {
+ return pd.wait('r')
}
-func (pd *pollDesc) WaitWrite() error {
- return pd.Wait('w')
+func (pd *pollDesc) waitWrite() error {
+ return pd.wait('w')
}
-func (pd *pollDesc) WaitCanceled(mode int) {
+func (pd *pollDesc) waitCanceled(mode int) {
runtime_pollWaitCanceled(pd.runtimeCtx, mode)
}
-func (pd *pollDesc) WaitCanceledRead() {
- pd.WaitCanceled('r')
+func (pd *pollDesc) waitCanceledRead() {
+ pd.waitCanceled('r')
}
-func (pd *pollDesc) WaitCanceledWrite() {
- pd.WaitCanceled('w')
+func (pd *pollDesc) waitCanceledWrite() {
+ pd.waitCanceled('w')
}
func convertErr(res int) error {
diff --git a/src/net/fd_unix.go b/src/net/fd_unix.go
index 82590c2..cb9b2f1 100644
--- a/src/net/fd_unix.go
+++ b/src/net/fd_unix.go
@@ -45,7 +45,7 @@
}
func (fd *netFD) init() error {
- if err := fd.pd.Init(fd); err != nil {
+ if err := fd.pd.init(fd); err != nil {
return err
}
return nil
@@ -124,7 +124,7 @@
// SO_ERROR socket option to see if the connection
// succeeded or failed. See issue 7474 for further
// details.
- if err := fd.pd.WaitWrite(); err != nil {
+ if err := fd.pd.waitWrite(); err != nil {
select {
case <-cancel:
return errCanceled
@@ -158,7 +158,7 @@
func (fd *netFD) destroy() {
// Poller may want to unregister fd in readiness notification mechanism,
// so this must be executed before closeFunc.
- fd.pd.Close()
+ fd.pd.close()
closeFunc(fd.sysfd)
fd.sysfd = -1
runtime.SetFinalizer(fd, nil)
@@ -167,7 +167,7 @@
// Add a reference to this fd.
// Returns an error if the fd cannot be used.
func (fd *netFD) incref() error {
- if !fd.fdmu.Incref() {
+ if !fd.fdmu.incref() {
return errClosing
}
return nil
@@ -176,7 +176,7 @@
// Remove a reference to this FD and close if we've been asked to do so
// (and there are no references left).
func (fd *netFD) decref() {
- if fd.fdmu.Decref() {
+ if fd.fdmu.decref() {
fd.destroy()
}
}
@@ -184,7 +184,7 @@
// Add a reference to this fd and lock for reading.
// Returns an error if the fd cannot be used.
func (fd *netFD) readLock() error {
- if !fd.fdmu.RWLock(true) {
+ if !fd.fdmu.rwlock(true) {
return errClosing
}
return nil
@@ -192,7 +192,7 @@
// Unlock for reading and remove a reference to this FD.
func (fd *netFD) readUnlock() {
- if fd.fdmu.RWUnlock(true) {
+ if fd.fdmu.rwunlock(true) {
fd.destroy()
}
}
@@ -200,7 +200,7 @@
// Add a reference to this fd and lock for writing.
// Returns an error if the fd cannot be used.
func (fd *netFD) writeLock() error {
- if !fd.fdmu.RWLock(false) {
+ if !fd.fdmu.rwlock(false) {
return errClosing
}
return nil
@@ -208,13 +208,13 @@
// Unlock for writing and remove a reference to this FD.
func (fd *netFD) writeUnlock() {
- if fd.fdmu.RWUnlock(false) {
+ if fd.fdmu.rwunlock(false) {
fd.destroy()
}
}
func (fd *netFD) Close() error {
- if !fd.fdmu.IncrefAndClose() {
+ if !fd.fdmu.increfAndClose() {
return errClosing
}
// Unblock any I/O. Once it all unblocks and returns,
@@ -222,7 +222,7 @@
// the final decref will close fd.sysfd. This should happen
// fairly quickly, since all the I/O is non-blocking, and any
// attempts to block in the pollDesc will return errClosing.
- fd.pd.Evict()
+ fd.pd.evict()
fd.decref()
return nil
}
@@ -248,7 +248,7 @@
return 0, err
}
defer fd.readUnlock()
- if err := fd.pd.PrepareRead(); err != nil {
+ if err := fd.pd.prepareRead(); err != nil {
return 0, err
}
for {
@@ -256,7 +256,7 @@
if err != nil {
n = 0
if err == syscall.EAGAIN {
- if err = fd.pd.WaitRead(); err == nil {
+ if err = fd.pd.waitRead(); err == nil {
continue
}
}
@@ -275,7 +275,7 @@
return 0, nil, err
}
defer fd.readUnlock()
- if err := fd.pd.PrepareRead(); err != nil {
+ if err := fd.pd.prepareRead(); err != nil {
return 0, nil, err
}
for {
@@ -283,7 +283,7 @@
if err != nil {
n = 0
if err == syscall.EAGAIN {
- if err = fd.pd.WaitRead(); err == nil {
+ if err = fd.pd.waitRead(); err == nil {
continue
}
}
@@ -302,7 +302,7 @@
return 0, 0, 0, nil, err
}
defer fd.readUnlock()
- if err := fd.pd.PrepareRead(); err != nil {
+ if err := fd.pd.prepareRead(); err != nil {
return 0, 0, 0, nil, err
}
for {
@@ -310,7 +310,7 @@
if err != nil {
// TODO(dfc) should n and oobn be set to 0
if err == syscall.EAGAIN {
- if err = fd.pd.WaitRead(); err == nil {
+ if err = fd.pd.waitRead(); err == nil {
continue
}
}
@@ -329,7 +329,7 @@
return 0, err
}
defer fd.writeUnlock()
- if err := fd.pd.PrepareWrite(); err != nil {
+ if err := fd.pd.prepareWrite(); err != nil {
return 0, err
}
for {
@@ -342,7 +342,7 @@
break
}
if err == syscall.EAGAIN {
- if err = fd.pd.WaitWrite(); err == nil {
+ if err = fd.pd.waitWrite(); err == nil {
continue
}
}
@@ -365,13 +365,13 @@
return 0, err
}
defer fd.writeUnlock()
- if err := fd.pd.PrepareWrite(); err != nil {
+ if err := fd.pd.prepareWrite(); err != nil {
return 0, err
}
for {
err = syscall.Sendto(fd.sysfd, p, 0, sa)
if err == syscall.EAGAIN {
- if err = fd.pd.WaitWrite(); err == nil {
+ if err = fd.pd.waitWrite(); err == nil {
continue
}
}
@@ -391,13 +391,13 @@
return 0, 0, err
}
defer fd.writeUnlock()
- if err := fd.pd.PrepareWrite(); err != nil {
+ if err := fd.pd.prepareWrite(); err != nil {
return 0, 0, err
}
for {
n, err = syscall.SendmsgN(fd.sysfd, p, oob, sa, 0)
if err == syscall.EAGAIN {
- if err = fd.pd.WaitWrite(); err == nil {
+ if err = fd.pd.waitWrite(); err == nil {
continue
}
}
@@ -420,7 +420,7 @@
var s int
var rsa syscall.Sockaddr
- if err = fd.pd.PrepareRead(); err != nil {
+ if err = fd.pd.prepareRead(); err != nil {
return nil, err
}
for {
@@ -432,7 +432,7 @@
}
switch nerr.Err {
case syscall.EAGAIN:
- if err = fd.pd.WaitRead(); err == nil {
+ if err = fd.pd.waitRead(); err == nil {
continue
}
case syscall.ECONNABORTED:
diff --git a/src/net/fd_windows.go b/src/net/fd_windows.go
index abdee9d..994033c 100644
--- a/src/net/fd_windows.go
+++ b/src/net/fd_windows.go
@@ -152,7 +152,7 @@
func (s *ioSrv) ExecIO(o *operation, name string, submit func(o *operation) error) (int, error) {
fd := o.fd
// Notify runtime netpoll about starting IO.
- err := fd.pd.Prepare(int(o.mode))
+ err := fd.pd.prepare(int(o.mode))
if err != nil {
return 0, err
}
@@ -180,7 +180,7 @@
return 0, err
}
// Wait for our request to complete.
- err = fd.pd.Wait(int(o.mode))
+ err = fd.pd.wait(int(o.mode))
if err == nil {
// All is good. Extract our IO results and return.
if o.errno != 0 {
@@ -210,7 +210,7 @@
<-o.errc
}
// Wait for cancelation to complete.
- fd.pd.WaitCanceled(int(o.mode))
+ fd.pd.waitCanceled(int(o.mode))
if o.errno != 0 {
err = syscall.Errno(o.errno)
if err == syscall.ERROR_OPERATION_ABORTED { // IO Canceled
@@ -273,7 +273,7 @@
}
func (fd *netFD) init() error {
- if err := fd.pd.Init(fd); err != nil {
+ if err := fd.pd.init(fd); err != nil {
return err
}
if hasLoadSetFileCompletionNotificationModes {
@@ -388,7 +388,7 @@
}
// Poller may want to unregister fd in readiness notification mechanism,
// so this must be executed before closeFunc.
- fd.pd.Close()
+ fd.pd.close()
closeFunc(fd.sysfd)
fd.sysfd = syscall.InvalidHandle
// no need for a finalizer anymore
@@ -398,7 +398,7 @@
// Add a reference to this fd.
// Returns an error if the fd cannot be used.
func (fd *netFD) incref() error {
- if !fd.fdmu.Incref() {
+ if !fd.fdmu.incref() {
return errClosing
}
return nil
@@ -407,7 +407,7 @@
// Remove a reference to this FD and close if we've been asked to do so
// (and there are no references left).
func (fd *netFD) decref() {
- if fd.fdmu.Decref() {
+ if fd.fdmu.decref() {
fd.destroy()
}
}
@@ -415,7 +415,7 @@
// Add a reference to this fd and lock for reading.
// Returns an error if the fd cannot be used.
func (fd *netFD) readLock() error {
- if !fd.fdmu.RWLock(true) {
+ if !fd.fdmu.rwlock(true) {
return errClosing
}
return nil
@@ -423,7 +423,7 @@
// Unlock for reading and remove a reference to this FD.
func (fd *netFD) readUnlock() {
- if fd.fdmu.RWUnlock(true) {
+ if fd.fdmu.rwunlock(true) {
fd.destroy()
}
}
@@ -431,7 +431,7 @@
// Add a reference to this fd and lock for writing.
// Returns an error if the fd cannot be used.
func (fd *netFD) writeLock() error {
- if !fd.fdmu.RWLock(false) {
+ if !fd.fdmu.rwlock(false) {
return errClosing
}
return nil
@@ -439,17 +439,17 @@
// Unlock for writing and remove a reference to this FD.
func (fd *netFD) writeUnlock() {
- if fd.fdmu.RWUnlock(false) {
+ if fd.fdmu.rwunlock(false) {
fd.destroy()
}
}
func (fd *netFD) Close() error {
- if !fd.fdmu.IncrefAndClose() {
+ if !fd.fdmu.increfAndClose() {
return errClosing
}
// unblock pending reader and writer
- fd.pd.Evict()
+ fd.pd.evict()
fd.decref()
return nil
}
diff --git a/src/net/sendfile_dragonfly.go b/src/net/sendfile_dragonfly.go
index 03bfe58..17021c3 100644
--- a/src/net/sendfile_dragonfly.go
+++ b/src/net/sendfile_dragonfly.go
@@ -81,7 +81,7 @@
break
}
if err1 == syscall.EAGAIN {
- if err1 = c.pd.WaitWrite(); err1 == nil {
+ if err1 = c.pd.waitWrite(); err1 == nil {
continue
}
}
diff --git a/src/net/sendfile_freebsd.go b/src/net/sendfile_freebsd.go
index 89ed0c3..f7a8529 100644
--- a/src/net/sendfile_freebsd.go
+++ b/src/net/sendfile_freebsd.go
@@ -81,7 +81,7 @@
break
}
if err1 == syscall.EAGAIN {
- if err1 = c.pd.WaitWrite(); err1 == nil {
+ if err1 = c.pd.waitWrite(); err1 == nil {
continue
}
}
diff --git a/src/net/sendfile_linux.go b/src/net/sendfile_linux.go
index e718e7f..7e741f9 100644
--- a/src/net/sendfile_linux.go
+++ b/src/net/sendfile_linux.go
@@ -57,7 +57,7 @@
break
}
if err1 == syscall.EAGAIN {
- if err1 = c.pd.WaitWrite(); err1 == nil {
+ if err1 = c.pd.waitWrite(); err1 == nil {
continue
}
}
diff --git a/src/net/sendfile_solaris.go b/src/net/sendfile_solaris.go
index 11820bb..eb9d2d1 100644
--- a/src/net/sendfile_solaris.go
+++ b/src/net/sendfile_solaris.go
@@ -87,7 +87,7 @@
break
}
if err1 == syscall.EAGAIN {
- if err1 = c.pd.WaitWrite(); err1 == nil {
+ if err1 = c.pd.waitWrite(); err1 == nil {
continue
}
}