mirror of
https://github.com/bcicen/ctop.git
synced 2025-11-15 15:35:49 +01:00
prevent unlock until container sort complete
This commit is contained in:
@@ -161,9 +161,9 @@ func (cm *Docker) All() (containers container.Containers) {
|
||||
for _, c := range cm.containers {
|
||||
containers = append(containers, c)
|
||||
}
|
||||
cm.lock.Unlock()
|
||||
sort.Sort(containers)
|
||||
containers.Filter()
|
||||
cm.lock.Unlock()
|
||||
return containers
|
||||
}
|
||||
|
||||
|
||||
@@ -192,9 +192,9 @@ func (cm *Runc) All() (containers container.Containers) {
|
||||
for _, c := range cm.containers {
|
||||
containers = append(containers, c)
|
||||
}
|
||||
cm.lock.Unlock()
|
||||
sort.Sort(containers)
|
||||
containers.Filter()
|
||||
cm.lock.Unlock()
|
||||
return containers
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user