mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07: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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user