From d7e2fc898284fe29ed43f7b28eae56e7e052e854 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 21 Nov 2013 08:06:02 -0500 Subject: [PATCH] Lock state before we modify. When we start a container we lock state, we should do the same in stop. Detected via -race. --- container.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/container.go b/container.go index 16f45cb490..d6b73f57cb 100644 --- a/container.go +++ b/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)