// group asyncs and return err in Result for the first async with error
552765
func Any(asyncs ...Async) Async {
	return &asyncImpl{
		cancel: func() {
			for _, a := range asyncs {
				a.Cancel()
			}
		},
		promise: Promise(func() error {
			// TODO (m0sth8): rewrite this with select for every async
			for _, a := range asyncs {
				err := <-a.Result()
				if err != nil {
					return err
				}
			}
			return nil
		}),
	}
}
1093520
func (t *Task) Cgroup() (cgroups.Cgroup, error) {
	t.mu.Lock()
	defer t.mu.Unlock()
	if t.cg == nil {
		return nil, errors.Wrap(errdefs.ErrNotFound, "cgroup does not exist")
	}
	return t.cg, nil
}
662659
func (f *asyncFlusher) waitAll() (int, error) {
	close(f.chunks)
	f.wg.Wait()
	if len(f.errs) == 0 {
		return f.rowsSent, nil
	}
	return f.rowsSent, f.errs
}
110597
func (n *NetworkServerAPI) FlushMulticastQueueForMulticastGroup(ctx context.Context, req *ns.FlushMulticastQueueForMulticastGroupRequest) (*empty.Empty, error) {
	var mgID uuid.UUID
	copy(mgID[:], req.MulticastGroupId)

	if err := storage.FlushMulticastQueueForMulticastGroup(storage.DB(), mgID); err != nil {
		return nil, errToRPCError(err)
	}

	return &empty.Empty{}, nil
}
75661
func (wg *WaitGroup) Go(cb func()) {
	wg.wg.Add(1)
	go func() {
		cb()
		wg.wg.Done()
	}()
}
850507
func (wg *SafeWaitGroup) Wait() {
	wg.mu.Lock()
	wg.wait = true
	wg.mu.Unlock()
	wg.wg.Wait()
}
629716
func (n *BuilderNode) Group() *BuilderGroup {
	return n.builder.groups[n.builder.ring.NodeToGroup[n.index]]
}
1369897
func (c *Callbacks) OnCDemoSpawnGroups(fn func(*dota.CDemoSpawnGroups) error) {
	c.onCDemoSpawnGroups = append(c.onCDemoSpawnGroups, fn)
}
36535
func Group(group string) (*apimachinery.GroupMeta, error) {
	groupMeta, found := groupMetaMap[group]
	if !found {
		return nil, fmt.Errorf("group %v has not been registered", group)
	}
	groupMetaCopy := *groupMeta
	return &groupMetaCopy, nil
}
279824
func (g *Group) Error() *Statement {
	// notest
	s := Error()
	g.items = append(g.items, s)
	return s
}
530520
func NewChordAsyncResult(groupTasks []*tasks.Signature, chordCallback *tasks.Signature, backend iface.Backend) *ChordAsyncResult {
	asyncResults := make([]*AsyncResult, len(groupTasks))
	for i, task := range groupTasks {
		asyncResults[i] = NewAsyncResult(task, backend)
	}
	return &ChordAsyncResult{
		groupAsyncResults: asyncResults,
		chordAsyncResult:  NewAsyncResult(chordCallback, backend),
		backend:           backend,
	}
}
1098102
func (prod *SimpleProducer) SetWorkerWaitGroup(workers *sync.WaitGroup) {
	prod.runState.SetWorkerWaitGroup(workers)
}
681754
func (g *Group) FlushAndSync() error {
	g.mtx.Lock()
	defer g.mtx.Unlock()
	err := g.headBuf.Flush()
	if err == nil {
		err = g.Head.Sync()
	}
	return err
}
786910
func (c *Conn) JoinGroup(group uint32) error {
	conn, ok := c.sock.(groupJoinLeaver)
	if !ok {
		return notSupported("join-group")
	}

	return newOpError("join-group", conn.JoinGroup(group))
}
763414
func (trs *TaskResultSet) FirstError() error {
	for _, result := range trs.results {
		if result.Error != nil {
			return result.Error
		}
	}
	return nil
}
1224376
func (wg *WaitGroup) Wait() []error {
	wg.wg.Wait()

	wg.mutex.Lock()
	defer wg.mutex.Unlock()

	if len(wg.errs) == 0 {
		return nil
	}
	return wg.errs
}
771380
func (b *BigIP) ConfigSyncToGroup(name string) error {
	args := "config-sync to-group "+name
	config := &ConfigSync{
		Command: "run",
		UtilCmdArgs: args,
	}
	return b.post(config, uriCm)
}