Fix race in get/set HostConfig

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: fa7c8d523e8d899ade547fcaacc34a739ab5044f
Component: engine
This commit is contained in:
Alexandr Morozov
2014-06-05 11:17:09 +04:00
parent ab194686ba
commit 5c1bb534bb

View File

@ -808,11 +808,16 @@ func (container *Container) GetPtyMaster() (*os.File, error) {
}
func (container *Container) HostConfig() *runconfig.HostConfig {
return container.hostConfig
container.Lock()
res := container.hostConfig
container.Unlock()
return res
}
func (container *Container) SetHostConfig(hostConfig *runconfig.HostConfig) {
container.Lock()
container.hostConfig = hostConfig
container.Unlock()
}
func (container *Container) DisableLink(name string) {