pgraph: Simplify graph exit waiting

I think the vertex resource exiting can be done in a single stage
instead of the previous two stage exit.
This commit is contained in:
James Shubin
2016-12-20 05:08:34 -05:00
parent 0009d9b20e
commit 2c8c9264a4
2 changed files with 3 additions and 9 deletions

View File

@@ -502,11 +502,6 @@ func (g *Graph) Start(first bool) { // start or continue
wg.Wait() // wait for everyone
}
// Wait waits for all the graph vertex workers to exit.
func (g *Graph) Wait() {
g.wg.Wait()
}
// Pause sends pause events to the graph in a topological sort order.
func (g *Graph) Pause() {
log.Printf("State: %v -> %v", g.setState(graphStatePausing), g.getState())
@@ -532,4 +527,5 @@ func (g *Graph) Exit() {
v.SendEvent(event.EventExit, true, false)
}
g.wg.Wait() // for now, this doesn't need to be a separate Wait() method
}