// StartWithChannel starts f in a new goroutine in the group.
// stopCh is passed to f as an argument. f should stop when stopCh is available.
15330
func (g *Group) StartWithChannel(stopCh <-chan struct{}, f func(stopCh <-chan struct{})) {
	g.Start(func() {
		f(stopCh)
	})
}
790169
func (api *Client) LeaveChannel(channelID string) (bool, error) {
	return api.LeaveChannelContext(context.Background(), channelID)
}
169781
func (p *Daemon) Start() error {
	p.lock.Lock()
	defer p.lock.Unlock()

	// A stopped proxy cannot be restarted
	if p.stopped {
		return fmt.Errorf("stopped")
	}

	// If we're already running, that is okay
	if p.process != nil {
		return nil
	}

	// Setup our stop channel
	stopCh := make(chan struct{})
	exitedCh := make(chan struct{})
	p.stopCh = stopCh
	p.exitedCh = exitedCh

	// Start the loop.
	go p.keepAlive(stopCh, exitedCh)

	return nil
}
168035
func (h *discoverProviderHealer) Start() {
	// check if started channel is already filled
	// if not, we start a new loop
	select {
	case h.started <- struct{}{}:
	default:
		return
	}

	go func() {
		for {
			// loop or quit
			select {
			case <-h.node.clock.After(h.period):
			case <-h.quit:
				return
			}

			// attempt heal with the pro
			if h.rand.Float64() < h.Probability() {
				h.Heal()
			}
		}
	}()
}
577456
func (command *Command) Start(wg *sync.WaitGroup) StopChan {
	process := exec.Command(command.Program, command.Args...)
	if command.LogDir != "" && command.LogFile != "" {
		logF, err := openLogfile(command.LogDir, command.LogFile)
		if err != nil {
			return NewStoppedChan(err)
		}
		command.LogFile = logF.Name()
		process.Stdout = logF
		process.Stderr = logF
	} else {
		command.LogFile = ""
		process.Stdout = nil
		process.Stderr = nil
	}

	err := process.Start()
	if err != nil {
		return NewStoppedChan(err)
	}

	if command.ShortName == "" {
		command.ShortName = command.Program
	}
	command.processFinished = NewStopChan()
	command.Proc = process.Process

	wg.Add(1)
	go command.waitForProcess(wg)
	return command.processFinished
}
939752
func (n *Network) PeersWithChannel(chanName string) []*Peer {
	peers := []*Peer{}
	for _, p := range n.Peers {
		for _, c := range p.Channels {
			if c.Name == chanName {
				peers = append(peers, p)
			}
		}
	}
	return peers
}
430923
func (c *ContextAction) TriggerChannel(channel *Channel) {
	packet := MumbleProto.ContextAction{
		ChannelId: &channel.ID,
		Action:    &c.Name,
	}
	c.client.Conn.WriteProto(&packet)
}
895938
func Resume(channel int) {
	_channel := (C.int)(channel)
	C.Mix_Resume(_channel)
}
634472
func (mr *MockClusterMockRecorder) StartWithConfiguration(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartWithConfiguration", reflect.TypeOf((*MockCluster)(nil).StartWithConfiguration), arg0, arg1, arg2, arg3, arg4, arg5)
}
82878
func Start() {
	initLimit()
	initSettings()
	initLogFuncs()
	initFolders()
	setEnvVars()
	watch()
	start()
	startChannel <- "/"

	<-make(chan int)
}
229464
func (s *volumeStatCalculator) StopOnce() *volumeStatCalculator {
	s.stopO.Do(func() {
		close(s.stopChannel)
	})
	return s
}
807861
func (fos *FanOutSink) Start() {
	fos.errs = make(chan error, len(fos.sinks))
	fos.cancelled = make(chan struct{})

	for _, sink := range fos.sinks {
		go func(sink Sink) {
			for {
				select {
				case <-fos.cancelled:
					// stop handling requests!
					fos.errs <- nil
					return
				case store, ok := <-fos.stores:
					if !ok {
						// no more requests to handle
						fos.errs <- nil
						return
					}

					err := sink.Store(store.loc, store.data)
					if err != nil {
						fos.errs <- err
						return
					}
				}
			}
		}(sink)
	}
}
261999
func (m *Monitor) Start() {
	monitorStopFunc := func(monitorFunc func() error) func(stopSignal chan struct{}) {
		return func(stopSignal chan struct{}) {
			for {
				select {
				case <-stopSignal:
					return
				default:
					monitorFunc()
				}
			}
		}
	}

	monitorSerial := monitorStopFunc(m.serialDiscover)
	monitorNetwork := monitorStopFunc(m.networkDiscover)

	m.stoppable = cc.Run(monitorSerial, monitorNetwork)
}
14737
func (s *Server) Start(ctx context.Context) {
	go func() {
		defer s.Close()
		<-ctx.Done()
		logger := log.FromContext(ctx)
		logger.Info("I have to go...")
		logger.Info("Stopping server gracefully")
		s.Stop()
	}()

	s.startTCPServers()
	s.routinesPool.Go(func(stop chan bool) {
		s.listenProviders(stop)
	})
	s.routinesPool.Go(func(stop chan bool) {
		s.listenConfigurations(stop)
	})
	s.startProvider()
	s.routinesPool.Go(func(stop chan bool) {
		s.listenSignals(stop)
	})
}
1161727
func StartWith(input string, appName string) error {
	return openWith(input, appName).Start()
}
25720
func (a *Astilectron) Stop() {
	astilog.Debug("Stopping...")
	a.canceller.Cancel()
	a.closeOnce.Do(func() {
		close(a.channelQuit)
	})
}
168383
func (c *Client) GoWithTimeout(method string, timeout time.Duration, args ...interface{}) chan *response {
	// We will return this channel to the caller.
	// It can wait on this channel to get the response.
	responseChan := make(chan *response, 1)

	c.sendMethod(method, args, timeout, responseChan)

	return responseChan
}