1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package libpod func (r *Runtime) startWorker() { r.workerChannel = make(chan func(), 10) go func() { for w := range r.workerChannel { w() r.workerGroup.Done() } }() } func (r *Runtime) queueWork(f func()) { r.workerGroup.Add(1) go func() { r.workerChannel <- f }() }