File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -213,8 +213,8 @@ func (ar *allocRunner) Run() {
213
213
goto POST
214
214
}
215
215
216
- // Run the runners and block until they exit
217
- <- ar .runTasks ()
216
+ // Run the runners (blocks until they exit)
217
+ ar .runTasks ()
218
218
219
219
POST:
220
220
// Run the postrun hooks
@@ -249,23 +249,15 @@ func (ar *allocRunner) shouldRun() bool {
249
249
return true
250
250
}
251
251
252
- // runTasks is used to run the task runners.
253
- func (ar * allocRunner ) runTasks () <- chan struct {} {
252
+ // runTasks is used to run the task runners and block until they exit .
253
+ func (ar * allocRunner ) runTasks () {
254
254
for _ , task := range ar .tasks {
255
255
go task .Run ()
256
256
}
257
257
258
- // Return a combined WaitCh that is closed when all task runners have
259
- // exited.
260
- waitCh := make (chan struct {})
261
- go func () {
262
- defer close (waitCh )
263
- for _ , task := range ar .tasks {
264
- <- task .WaitCh ()
265
- }
266
- }()
267
-
268
- return waitCh
258
+ for _ , task := range ar .tasks {
259
+ <- task .WaitCh ()
260
+ }
269
261
}
270
262
271
263
// Alloc returns the current allocation being run by this runner as sent by the
You can’t perform that action at this time.
0 commit comments