From a721a505bf747b3b6505a5f135c04d39197fba86 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 15:35:31 +1000 Subject: [PATCH] Document the reason for a restriction. --- connection.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 964c48d..4e83b8b 100644 --- a/connection.go +++ b/connection.go @@ -388,6 +388,9 @@ func (c *Connection) waitForReady() (err error) { // Close the connection. Must not be called until operations that were read // from the connection have been responded to. func (c *Connection) close() (err error) { - err = c.wrapped.Close() + // Posix doesn't say that close can be called concurrently with read or + // write, but luckily we exclude the possibility of a race by requiring the + // user to respond to all ops first. + err = c.dev.Close() return }