diff options
Diffstat (limited to 'libgo/go/net/fd_unix.go')
-rw-r--r-- | libgo/go/net/fd_unix.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libgo/go/net/fd_unix.go b/libgo/go/net/fd_unix.go index e9d2e4165f1..42b0c74f218 100644 --- a/libgo/go/net/fd_unix.go +++ b/libgo/go/net/fd_unix.go @@ -110,16 +110,24 @@ func (s *pollServer) AddFD(fd *netFD, mode int) error { // any I/O running on fd. The caller must have locked // pollserver. func (s *pollServer) Evict(fd *netFD) { + doWakeup := false if s.pending[fd.sysfd<<1] == fd { s.WakeFD(fd, 'r', errClosing) - s.poll.DelFD(fd.sysfd, 'r') + if s.poll.DelFD(fd.sysfd, 'r') { + doWakeup = true + } delete(s.pending, fd.sysfd<<1) } if s.pending[fd.sysfd<<1|1] == fd { s.WakeFD(fd, 'w', errClosing) - s.poll.DelFD(fd.sysfd, 'w') + if s.poll.DelFD(fd.sysfd, 'w') { + doWakeup = true + } delete(s.pending, fd.sysfd<<1|1) } + if doWakeup { + s.Wakeup() + } } var wakeupbuf [1]byte |