From 5dffab743986d20464efc0bfbec04c75d8075c66 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 10 Dec 2013 16:23:47 -0800 Subject: [PATCH] packer/rpc: need a real lock for closing --- packer/rpc/muxconn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packer/rpc/muxconn.go b/packer/rpc/muxconn.go index 63ac39139..08c28bb25 100644 --- a/packer/rpc/muxconn.go +++ b/packer/rpc/muxconn.go @@ -48,8 +48,8 @@ func NewMuxConn(rwc io.ReadWriteCloser) *MuxConn { // Close closes the underlying io.ReadWriteCloser. This will also close // all streams that are open. func (m *MuxConn) Close() error { - m.mu.RLock() - defer m.mu.RUnlock() + m.mu.Lock() + defer m.mu.Unlock() // Close all the streams for _, w := range m.streams {