]> Cypherpunks repositories - gostls13.git/commitdiff
net: remove the dregs of old built-in poll server
authorMikio Hara <mikioh.mikioh@gmail.com>
Wed, 4 Feb 2015 09:00:52 +0000 (18:00 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Wed, 4 Feb 2015 10:16:38 +0000 (10:16 +0000)
We don't need placeholders for the old built-in poll server any more.

Change-Id: I3a510aec6a30bc2ac97676c400177cdfe557b8dc
Reviewed-on: https://go-review.googlesource.com/3863
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
src/net/fd_poll_nacl.go
src/net/fd_poll_runtime.go
src/net/fd_unix.go

index a3701f8764833fcee124e49119ef13d8bdc14737..cdf14e32ce8010683acf8601253e5a845fc35c8a 100644 (file)
@@ -18,18 +18,11 @@ func (pd *pollDesc) Init(fd *netFD) error { pd.fd = fd; return nil }
 
 func (pd *pollDesc) Close() {}
 
-func (pd *pollDesc) Lock() {}
-
-func (pd *pollDesc) Unlock() {}
-
-func (pd *pollDesc) Wakeup() {}
-
-func (pd *pollDesc) Evict() bool {
+func (pd *pollDesc) Evict() {
        pd.closing = true
        if pd.fd != nil {
                syscall.StopIO(pd.fd.sysfd)
        }
-       return false
 }
 
 func (pd *pollDesc) Prepare(mode int) error {
index 2bddc836c75a7af4492cbb5a748c74fc6a3ad991..8522ccebfb364315c2d5f57213d67b1d697a0a5a 100644 (file)
@@ -48,23 +48,12 @@ func (pd *pollDesc) Close() {
        pd.runtimeCtx = 0
 }
 
-func (pd *pollDesc) Lock() {
-}
-
-func (pd *pollDesc) Unlock() {
-}
-
-func (pd *pollDesc) Wakeup() {
-}
-
 // Evict evicts fd from the pending list, unblocking any I/O running on fd.
-// Return value is whether the pollServer should be woken up.
-func (pd *pollDesc) Evict() bool {
+func (pd *pollDesc) Evict() {
        if pd.runtimeCtx == 0 {
-               return false
+               return
        }
        runtime_pollUnblock(pd.runtimeCtx)
-       return false
 }
 
 func (pd *pollDesc) Prepare(mode int) error {
index 16fe61085f806cf44716cd9dd7cfd44168223421..24e6c59f370785d141c1be6a1b6529e826ad8c1c 100644 (file)
@@ -187,9 +187,7 @@ func (fd *netFD) writeUnlock() {
 }
 
 func (fd *netFD) Close() error {
-       fd.pd.Lock() // needed for both fd.incref(true) and pollDesc.Evict
        if !fd.fdmu.IncrefAndClose() {
-               fd.pd.Unlock()
                return errClosing
        }
        // Unblock any I/O.  Once it all unblocks and returns,
@@ -197,12 +195,8 @@ func (fd *netFD) Close() error {
        // 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.
-       doWakeup := fd.pd.Evict()
-       fd.pd.Unlock()
+       fd.pd.Evict()
        fd.decref()
-       if doWakeup {
-               fd.pd.Wakeup()
-       }
        return nil
 }