// Stop stops the container with a default timeout.
508651
func (p *Project) Stop(containerID string) error {
	return p.StopWithTimeout(containerID, DefaultStopTimeout)
}
365828
func (s *Scheduler) Stop(ctx context.Context, containerID string) error {
	container, err := s.docker.InspectContainer(containerID)
	if err != nil {
		return err
	}

	// Some extra protection around stopping containers. We don't want to
	// allow users to stop containers that may have been started outside of
	// Empire.
	if _, ok := container.Config.Labels[runLabel]; !ok {
		return &docker.NoSuchContainer{
			ID: containerID,
		}
	}

	if err := s.docker.StopContainer(ctx, containerID, stopContainerTimeout); err != nil {
		return err
	}

	return nil
}
1133418
func (sv *Service) Stop(t *testing.T) {
	defer os.RemoveAll(sv.dataDir)

	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	err := sv.httpServer.Shutdown(ctx)
	cancel()
	if err != nil && err != context.DeadlineExceeded {
		t.Fatal(err)
	}
	err = <-sv.httpErrc
	if err != nil {
		t.Fatal(err)
	}

	sv.rootCancel()
	sv.etcd.Close()
}
462655
func (t *Timer) Stop() bool {
	if t.timer != nil {
		return t.timer.Stop()
	}

	registered := !t.stopped
	t.mock.removeClockTimer((*internalTimer)(t))
	t.stopped = true
	return registered
}
732056
func (driver *MesosExecutorDriver) Stop() (mesosproto.Status, error) {
	driver.lock.Lock()
	defer driver.lock.Unlock()
	return driver.stop()
}
592819
func (s *Service) Pause(ctx context.Context) error {
	return s.collectContainersAndDo(ctx, func(c *container.Container) error {
		return c.Pause(ctx)
	})
}
982226
func (srv *Server) Stop() error {
	srv.tomb.Kill(nil)
	return srv.tomb.Wait()
}
1095029
func (cs *ChaincodeSupport) Stop(ccci *ccprovider.ChaincodeContainerInfo) error {
	return cs.Runtime.Stop(ccci)
}
428561
func (s *DurationRatioStat) Stop() {
	s.m.Lock()
	defer s.m.Unlock()
	s.isStarted = false
}
415818
func (s *Service) Stop() {
	eventch, err := s.dispatcher.EventCh()
	if err != nil {
		logger.Warnf("Error stopping event service: %s", err)
		return
	}

	errch := make(chan error)
	eventch <- dispatcher.NewStopEvent(errch)

	select {
	case err := <-errch:
		if err != nil {
			logger.Warnf("Error while stopping dispatcher: %s", err)
		}
	case <-time.After(stopTimeout):
		logger.Infof("Timed out waiting for dispatcher to stop")
	}
}
855875
func (tt *TimerToken) Stop() time.Duration {
	duration := time.Since(tt.Start)
	tt.MetricSystem.Histogram(tt.Name, float64(duration.Nanoseconds()))
	return duration
}
1061894
func (c *CCProviderImpl) Stop(ccci *ccprovider.ChaincodeContainerInfo) error {
	return c.cs.Stop(ccci)
}
259605
func (tm *Timer) Stop() {
	tm.mu.Lock()
	defer tm.mu.Unlock()
	if tm.running {
		tm.msg <- timerStop
		tm.running = false
	}
}
1320727
func (s *Server) Stop() error {
	ctx, cancel := context.WithTimeout(context.Background(), s.connTimeout)
	defer cancel()

	err := s.Server.Shutdown(ctx)
	if err != nil {
		return err
	}

	// signal any TLS governor goroutines to exit
	if s.tlsGovChan != nil {
		close(s.tlsGovChan)
	}

	return nil
}
1060547
func (p *Pipe) Stop() {
	if !p.Stopped {
		p.Stopped = true

		// we only worry about the stop channel if we're in a listening loop
		if p.listening {
			close(p.chStop)
			p.wg.Wait()
			return
		}

		timeout := time.After(10 * time.Second)
		for {
			select {
			case <-timeout:
				log.With("path", p.path).Errorln("timeout reached waiting for Out channels to clear")
				return
			default:
			}
			if p.empty() {
				return
			}
			time.Sleep(1 * time.Second)
		}
	}
}
425640
func (s *Service) Stop(ctx context.Context, timeout int) error {
	timeout = s.stopTimeout(timeout)
	return s.collectContainersAndDo(ctx, func(c *container.Container) error {
		return c.Stop(ctx, timeout)
	})
}
1049625
func (container *Container) StopTimeout() int {
	if container.Config.StopTimeout != nil {
		return *container.Config.StopTimeout
	}
	return DefaultStopTimeout
}