Browse Source

Merge pull request #2795 from pnasrat/docker-testmultipleattachrestart-race

Lock state before we modify.
Victor Vieux 11 năm trước cách đây
mục cha
commit
eaeb969138
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      container.go

+ 2 - 0
container.go

@@ -1300,7 +1300,9 @@ func (container *Container) monitor() {
 	}
 
 	// Report status back
+	container.State.Lock()
 	container.State.setStopped(exitCode)
+	container.State.Unlock()
 
 	// Release the lock
 	close(container.waitLock)