• Adam Langley's avatar
    net: remove race condition on Close. · ef8f483c
    Adam Langley authored
    Previously a netFd could be queued for reading/writing in the channel,
    but close(2)'ed before pollServer got to it. In this case, the kernel
    would consider the descriptor closed and the attempt to add it to the
    epoll set would fail and panic.
    
    This patch makes Close a roundtrip to the pollServer, although the
    actual close(2) still occurs elsewhere to avoid blocking the
    pollServer.
    
    Fixes #143.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/152130
    ef8f483c
fd.go 11.5 KB