Commit 5dffab74 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: need a real lock for closing

parent 7372c32b
...@@ -48,8 +48,8 @@ func NewMuxConn(rwc io.ReadWriteCloser) *MuxConn { ...@@ -48,8 +48,8 @@ func NewMuxConn(rwc io.ReadWriteCloser) *MuxConn {
// Close closes the underlying io.ReadWriteCloser. This will also close // Close closes the underlying io.ReadWriteCloser. This will also close
// all streams that are open. // all streams that are open.
func (m *MuxConn) Close() error { func (m *MuxConn) Close() error {
m.mu.RLock() m.mu.Lock()
defer m.mu.RUnlock() defer m.mu.Unlock()
// Close all the streams // Close all the streams
for _, w := range m.streams { for _, w := range m.streams {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment