mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
packer/rpc: need a real lock for closing
This commit is contained in:
parent
7372c32b6b
commit
5dffab7439
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue