Просмотр исходного кода

Lock state before we modify.

When we start a container we lock state, we should do the same in stop.

Detected via -race.
Paul Nasrat 11 лет назад
Родитель
Сommit
d7e2fc8982
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      container.go

+ 2 - 0
container.go

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