Browse code

Fix race between execdriver.Kill and execdriver.Run

Signed-off-by: Alexander Morozov <lk4d4@docker.com>

Alexander Morozov authored on 2015/05/12 05:23:50
Showing 1 changed files
... ...
@@ -245,7 +245,9 @@ func waitInPIDHost(p *libcontainer.Process, c libcontainer.Container) func() (*o
245 245
 }
246 246
 
247 247
 func (d *driver) Kill(c *execdriver.Command, sig int) error {
248
+	d.Lock()
248 249
 	active := d.activeContainers[c.ID]
250
+	d.Unlock()
249 251
 	if active == nil {
250 252
 		return fmt.Errorf("active container for %s does not exist", c.ID)
251 253
 	}