1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00

Merge pull request #19447 from sillyousu/19407-fix-exec-store-data-race

Fix race condition in execCommandGC
This commit is contained in:
Doug Davis
2016-01-20 07:46:28 -05:00

View File

@@ -53,7 +53,13 @@ func NewStore() *Store {
// Commands returns the exec configurations in the store.
func (e *Store) Commands() map[string]*Config {
return e.commands
e.RLock()
commands := make(map[string]*Config, len(e.commands))
for id, config := range e.commands {
commands[id] = config
}
e.RUnlock()
return commands
}
// Add adds a new exec configuration to the store.