code: func (r *Runner) dispatchLoop(sustained int, maximum int) {
  	defer close(r.dispatchFinishedC)
  
  	// If a Maximum is set, use Semaphore to enforce it.
  	if maximum > 0 {
  		spawnC := make(Semaphore, maximum)
  		r.dispatchLoopBody(sustained, spawnC.Lock, spawnC.Unlock)
  		spawnC.TakeAll()
  	} else {
  		// Unbounded number of goroutines. Use a WaitGroup to track them, and block
  		// until all of the task goroutines have completed.
  		var wg sync.WaitGroup
  		r.dispatchLoopBody(sustained, func() { wg.Add(1) }, wg.Done)
  		wg.Wait()
  	}
  }
docs: // disaptchLoop is run in a goroutine. It reads tasks from workC and executes
  // them.