lxd/task/group.go
func (g *Group) Add(f Func, schedule Schedule) *Task {
	i := len(g.tasks)
	g.tasks = append(g.tasks, Task{
		f:        f,
		schedule: schedule,
		reset:    make(chan struct{}, 16), // Buffered to not block senders
	})
	return &g.tasks[i]
}
func (g *Group) Add(f Func, schedule Schedule) *Task {
	i := len(g.tasks)
	g.tasks = append(g.tasks, Task{
		f:        f,
		schedule: schedule,
		reset:    make(chan struct{}, 16), // Buffered to not block senders
	})
	return &g.tasks[i]
}
func ( g * Group ) Add ( f Func , schedule Schedule ) * Task { i := len ( g . tasks ) g . tasks = append ( g . tasks , Task { f : f , schedule : schedule , reset : make ( chan struct { } , 16 ) , // Buffered to not block senders } ) return & g . tasks [ i ] }
// Add a new task to the group, returning its index.
Add a new task to the group returning its index .