code: func (c *controller) AgentStopWait() {
  	c.Lock()
  	agentStopDone := c.agentStopDone
  	c.Unlock()
  	if agentStopDone != nil {
  		<-agentStopDone
  	}
  }
docs: // AgentStopWait waits for the Agent stop to be completed in the controller