// Shutdown stops the program and cleans up temporary paths.
338145
func (tl *TestLauncher) Shutdown(ctx context.Context) error {
	tl.Cancel()
	tl.Launcher.Shutdown(ctx)
	return os.RemoveAll(tl.Path)
}
1363557
func (auto *AutoGcd) Shutdown() error {
	if auto.shutdown {
		return errors.New("AutoGcd already shut down.")
	}

	auto.tabLock.Lock()
	for _, tab := range auto.tabs {
		tab.close() // exit go routines
		auto.debugger.CloseTab(tab.ChromeTarget)

	}
	auto.tabLock.Unlock()

	if !auto.settings.connectToInstance {
		err := auto.debugger.ExitProcess()
		if auto.settings.removeUserDir == true {
			return os.RemoveAll(auto.settings.userDir)
		}
		return err
	}

	auto.shutdown = true
	return nil
}
1069059
func (c *client) Shutdown(ctx context.Context, waitForMysqld bool) error {
	return c.withRetry(ctx, func() error {
		_, err := c.c.Shutdown(ctx, &mysqlctlpb.ShutdownRequest{
			WaitForMysqld: waitForMysqld,
		})
		return err
	})
}
175201
func (cache *diskBlockCacheWrapped) Shutdown(ctx context.Context) {
	cache.mtx.Lock()
	defer cache.mtx.Unlock()
	cache.workingSetCache.Shutdown(ctx)
	if cache.syncCache != nil {
		cache.syncCache.Shutdown(ctx)
	}
}
1158004
func (fmd *FakeMysqlDaemon) Shutdown(ctx context.Context, cnf *mysqlctl.Mycnf, waitForMysqld bool) error {
	if !fmd.Running {
		return fmt.Errorf("fake mysql daemon not running")
	}
	fmd.Running = false
	return nil
}
1041550
func (w *Worker) Shutdown() {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.done {
		return
	}

	log.Println("worker shutting down gracefully...")
	w.ch <- struct{}{}
	w.done = true
	close(w.ch)
}
1062938
func (s *Server) Shutdown() {
	s.serverLock.Lock()
	defer s.serverLock.Unlock()
	s.server.Stop()
	s.cancel()
}
439452
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
	os.Exit(0)
	return empty, nil
}
797362
func (m *manager) Shutdown() {
	// Cancel the context to stop any requests
	m.cancel()

	// Go through and shut everything down
	for _, i := range m.instances {
		i.cleanup()
	}
}
280466
func (b *BlockOpsStandard) Shutdown(ctx context.Context) error {
	// Block on the queue being done.
	select {
	case <-b.queue.Shutdown():
		return nil
	case <-ctx.Done():
		return errors.WithStack(ctx.Err())
	}
}
1101363
func (s *Server) Shutdown() error {
	if !atomic.CompareAndSwapInt32(&s.shutdown, 0, 1) {
		// something else already closed us
		return nil
	}

	close(s.shutdownCh)

	if s.ipv4List != nil {
		s.ipv4List.Close()
	}
	if s.ipv6List != nil {
		s.ipv6List.Close()
	}
	return nil
}
694279
func (brw *blockRetrievalWorker) Shutdown() <-chan struct{} {
	select {
	case <-brw.stopCh:
	default:
		close(brw.stopCh)
	}
	return brw.doneCh
}
872249
func (s *ExtensionManagerServer) Shutdown(ctx context.Context) error {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	if s.server != nil {
		server := s.server
		s.server = nil
		// Stop the server asynchronously so that the current request
		// can complete. Otherwise, this is vulnerable to deadlock if a
		// shutdown request is being processed when shutdown is
		// explicitly called.
		go func() {
			server.Stop()
		}()
	}

	return nil
}
932736
func Shutdown(c context.Context) {
	state := GetState(c)
	if store.IsNilStore(state.Store()) {
		return
	}

	if state.flusher != nil {
		logging.Debugf(c, "Stopping tsmon auto flush")
		state.flusher.stop()
		state.flusher = nil
	}

	// Flush logs errors inside.
	Flush(c)

	// Reset the state as if 'InitializeFromFlags' was never called.
	Initialize(c, monitor.NewNilMonitor(), store.NewNilStore())
}
1167369
func (p *Proxy) Shutdown() {
	log.Info("Shutting down server gracefully")
	close(p.shutdown)
	graceful.Shutdown()
	p.gRPCStop()
}
469716
func (rc *Connector) Shutdown() error {
	hasError := false
	rConnErr := errors.New("failed to shutdown")
	for _, c := range rc.connectors {
		err := c.Shutdown()
		if err != nil {
			// save errors here, continue to shut down other connectors
			hasError = true
			err = errors.Wrap(rConnErr, err.Error())
			continue
		}
	}

	if hasError {
		return rConnErr
	}
	return nil
}
522260
func (container *container) Shutdown() error {
	err := container.system.Shutdown()
	if err != nil {
		return convertSystemError(err, container)
	}
	return &ContainerError{Container: container, Err: ErrVmcomputeOperationPending, Operation: "hcsshim::ComputeSystem::Shutdown"}
}