Skip to content

Commit

Permalink
Send the done notifications after finishing cancel routine
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jun 9, 2013
1 parent 0600b4c commit 5dbf3ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions basic_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ func (b *BasicRunner) Run(state map[string]interface{}) {
b.l.Lock()
defer b.l.Unlock()

if b.cancelChs != nil {
for _, doneCh := range b.cancelChs {
doneCh <- true
}
}

// Make sure the cancellation goroutine cleans up properly. This
// is a bit complicated. Basically, we first wait until the goroutine
// waiting for cancellation is actually waiting. Then we broadcast
Expand All @@ -66,6 +60,12 @@ func (b *BasicRunner) Run(state map[string]interface{}) {
b.cancelCond.L.Unlock()
<-cancelEnded

if b.cancelChs != nil {
for _, doneCh := range b.cancelChs {
doneCh <- true
}
}

b.running = false
}()

Expand Down

0 comments on commit 5dbf3ec

Please sign in to comment.