// Resume starts underlying time.Ticker and causes the ticker to begin
// delivering scheduled events.
//
// NOTE: Part of the Ticker interface.
344210
func (t *T) Resume() {
	if t.ticker == nil {
		t.ticker = time.NewTicker(t.interval)
	}
}
216118
func retry(ctx context.Context, f func() bool, delay time.Duration) error {
	if f() {
		return nil
	}

	ticker := time.NewTicker(delay)
	errChan := make(chan error)

	go func() {
		defer close(errChan)

		for {
			select {
			case <-ctx.Done():
				errChan <- ctx.Err()
				return
			case <-ticker.C:
				if f() {
					return
				}
			}
		}
	}()

	return <-errChan
}
1217368
func (t *Ticker) Run() {
	// ticker
	for {
		select {
		case <-t.Done:
			return
		case <-t.C:
			s, err := t.Get()
			if err != nil {
				t.Errs <- err
				continue
			}
			t.Data <- s
		}
	}
}
398443
func (s *scheduler) reset() {
	s.lock.Lock()
	defer s.lock.Unlock()

	for section, res := range s.responses {
		if res.cached == nil {
			delete(s.responses, section)
		}
	}
}
260316
func (d *Domain) Resume() error {
	var err C.virError
	result := C.virDomainResumeWrapper(d.ptr, &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
133326
func (t *Timer) Reset(d time.Duration) bool {
	return t.timer.Reset(d)
}
155703
func (r *realisClient) ResumeJobUpdate(updateKey *aurora.JobUpdateKey, message string) (*aurora.Response, error) {

	r.logger.DebugPrintf("ResumeJobUpdate Thrift Payload: %+v %v\n", updateKey, message)

	resp, retryErr := r.thriftCallWithRetries(func() (*aurora.Response, error) {
		return r.client.ResumeJobUpdate(nil, updateKey, message)
	})

	if retryErr != nil {
		return nil, errors.Wrap(retryErr, "Error sending ResumeJobUpdate command to Aurora Scheduler")
	}

	return resp, nil
}
742860
func (a *Agent) ResumeSync() {
	// a.sync maintains a stack/ref count of Pause calls since we call
	// Pause/Resume in nested way during a reload and AddService. We only want to
	// trigger local state watchers if this Resume call actually started sync back
	// up again (i.e. was the last resume on the stack). We could check that
	// separately with a.sync.Paused but that is racey since another Pause call
	// might be made between our Resume and checking Paused.
	resumed := a.sync.Resume()

	if !resumed {
		// Return early so we don't notify local watchers until we are actually
		// resumed.
		return
	}

	// Coordinate local state watchers
	a.syncMu.Lock()
	defer a.syncMu.Unlock()

	if a.syncCh != nil {
		close(a.syncCh)
		a.syncCh = nil
	}
}
1345669
func (m *Memberlist) deschedule() {
	m.tickerLock.Lock()
	defer m.tickerLock.Unlock()

	// If we have no tickers, then we aren't scheduled.
	if len(m.tickers) == 0 {
		return
	}

	// Close the stop channel so all the ticker listeners stop.
	close(m.stopTick)

	// Explicitly stop all the tickers themselves so they don't take
	// up any more resources, and get rid of the list.
	for _, t := range m.tickers {
		t.Stop()
	}
	m.tickers = nil
}
1198721
func (s *Server) Resume() {
	s.mu.Lock()
	defer s.mu.Unlock()
	s.shutdown = false
	for service := range s.statusMap {
		s.setServingStatusLocked(service, healthpb.HealthCheckResponse_SERVING)
	}
}
707924
func (m *monitor) Start(availablePlugins *availablePlugins) {
	//start a routine that will be fired every X duration looping
	//over available plugins and firing a health check routine
	ticker := time.NewTicker(m.duration)
	m.quit = make(chan struct{})
	go func() {
		for {
			select {
			case <-ticker.C:
				go func() {
					availablePlugins.RLock()
					for _, ap := range availablePlugins.all() {
						if !ap.IsRemote() {
							go ap.CheckHealth()
						}
					}
					availablePlugins.RUnlock()
				}()
			case <-m.quit:
				ticker.Stop()
				m.State = MonitorStopped
				return
			}
		}
	}()
	m.State = MonitorStarted
}
285774
func (s *service) Resume(ctx context.Context, r *taskAPI.ResumeRequest) (*ptypes.Empty, error) {
	log.G(ctx).Debugf("Resume: %s", r.ID)

	// TODO: Validate that 'id' is actually a valid parent container ID
	var p *process
	var err error
	if p, err = s.getProcess(r.ID, ""); err != nil {
		return nil, err
	}

	rhcs := s.newRunhcs()
	if err = rhcs.Resume(ctx, p.id); err != nil {
		return nil, err
	}

	s.publisher.Publish(ctx, runtime.TaskResumedEventTopic, &eventstypes.TaskResumed{
		ContainerID: r.ID,
	})

	return empty, nil
}
205201
func (s *Maestro) Start() {
	c := cron.New()
	c.AddFunc("@every 1m", s.PollCrazyPlans)
	c.AddFunc("@every 10m", s.PollAnnoyingPlans)
	c.AddFunc("@every 30m", s.PollMickeyMousePlans)
	c.Start()
}
819999
func (s *releasesService) Restart(ctx context.Context, db *gorm.DB, app *App) error {
	return s.Scheduler.Restart(ctx, app.ID, nil)
}
939296
func (l *rateLimiterImpl) Stop() {
	l.mutex.Lock()
	defer l.mutex.Unlock()

	if l.stopped {
		return
	}

	l.stopped = true

	close(l.stopChan)
	l.ticker.Stop()

	l.cond.Broadcast()
}
329066
func (s *SimpleTimer) Start() {
	if s.start == nil {
		tmp := time.Now()
		s.start = &tmp
	}
}
979103
func (s *scheduler) Stop() {
	s.Lock()
	defer s.Unlock()

	if !s.started {
		return
	}
	close(s.shutdown)
	<-s.stopped
}