code: func (a *Agent) stop() bool {
  	var stopped bool
  	a.stopOnce.Do(func() {
  		close(a.stopped)
  		stopped = true
  	})
  
  	return stopped
  }
docs: // stop signals the agent shutdown process, returning true if this call was the
  // first to actually shutdown the agent.