1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix race condition in sending started signal from monitor

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
This commit is contained in:
Alexandr Morozov 2014-08-14 11:01:39 +04:00
parent 17112704b9
commit 1480168e9f
No known key found for this signature in database
GPG key ID: 59BF89FA47378873

View file

@ -244,10 +244,12 @@ func (m *containerMonitor) callback(command *execdriver.Command) {
m.container.State.SetRunning(command.Pid()) m.container.State.SetRunning(command.Pid())
if m.startSignal != nil { // signal that the process has started
// signal that the process has started // close channel only if not closed
select {
case <-m.startSignal:
default:
close(m.startSignal) close(m.startSignal)
m.startSignal = nil
} }
if err := m.container.ToDisk(); err != nil { if err := m.container.ToDisk(); err != nil {