mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add lock before accessing native driver active containers
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
parent
77280a87b7
commit
9e425d56d0
1 changed files with 4 additions and 0 deletions
|
@ -259,7 +259,9 @@ func (d *driver) Kill(c *execdriver.Command, sig int) error {
|
|||
}
|
||||
|
||||
func (d *driver) Pause(c *execdriver.Command) error {
|
||||
d.Lock()
|
||||
active := d.activeContainers[c.ID]
|
||||
d.Unlock()
|
||||
if active == nil {
|
||||
return fmt.Errorf("active container for %s does not exist", c.ID)
|
||||
}
|
||||
|
@ -267,7 +269,9 @@ func (d *driver) Pause(c *execdriver.Command) error {
|
|||
}
|
||||
|
||||
func (d *driver) Unpause(c *execdriver.Command) error {
|
||||
d.Lock()
|
||||
active := d.activeContainers[c.ID]
|
||||
d.Unlock()
|
||||
if active == nil {
|
||||
return fmt.Errorf("active container for %s does not exist", c.ID)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue