mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix race in contStore.List
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
4cf40c968f
commit
0b3fe55442
1 changed files with 2 additions and 0 deletions
|
@ -72,9 +72,11 @@ func (c *contStore) Delete(id string) {
|
|||
|
||||
func (c *contStore) List() []*Container {
|
||||
containers := new(History)
|
||||
c.Lock()
|
||||
for _, cont := range c.s {
|
||||
containers.Add(cont)
|
||||
}
|
||||
c.Unlock()
|
||||
containers.Sort()
|
||||
return *containers
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue