in workflow.go [245:259]
func (w *Workflow) reset() {
for _, state := range w.steps {
state.SetStatus(Pending)
}
if w.Clock == nil {
w.Clock = clock.New()
}
w.statusChange = sync.NewCond(new(sync.Mutex))
if w.MaxConcurrency > 0 {
// use buffered channel as a sized bucket
// a Step needs to create a lease in the bucket to run,
// and remove the lease from the bucket when it's done.
w.leaseBucket = make(chan struct{}, w.MaxConcurrency)
}
}