aboutsummaryrefslogtreecommitdiff
path: root/libpod/runtime_worker.go
blob: 9d41321b282b6d7ecc213238c4240bb950226f6e (plain)
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
	}()
}