// Close terminates and releases resources associated with the utility VM.
769557
func (uvm *UtilityVM) Close() (err error) {
	op := "uvm::Close"
	log := logrus.WithFields(logrus.Fields{
		logfields.UVMID: uvm.id,
	})
	log.Debug(op + " - Begin Operation")
	defer func() {
		if err != nil {
			log.Data[logrus.ErrorKey] = err
			log.Error(op + " - End Operation - Error")
		} else {
			log.Debug(op + " - End Operation - Success")
		}
	}()

	uvm.hcsSystem.Terminate()
	uvm.Wait()

	// outputListener will only be nil for a Create -> Stop without a Start. In
	// this case we have no goroutine processing output so its safe to close the
	// channel here.
	if uvm.outputListener != nil {
		close(uvm.outputProcessingDone)
		uvm.outputListener.Close()
		uvm.outputListener = nil
	}
	return uvm.hcsSystem.Close()
}
57544
func (rp *ResourcePool) Close() {
	if rp.idleTimer != nil {
		rp.idleTimer.Stop()
	}
	_ = rp.SetCapacity(0)
}
706777
func (c *Client) Close() error {
	c.connMu.Lock()
	defer c.connMu.Unlock()
	if c.conn != nil {
		return c.conn.Close()
	}
	return nil
}
662847
func (c *Client) Close() error {
	if !c.running.Swap(false) {
		return nil // already stopped
	}

	var errors []error
	if err := c.stdout.Close(); err != nil {
		errors = append(errors, fmt.Errorf("failed to detach stdout from %q: %v", c.cmd.Path, err))
	}
	if err := c.stdin.Close(); err != nil {
		errors = append(errors, fmt.Errorf("failed to detach stdin from %q: %v", c.cmd.Path, err))
	}
	if err := c.cmd.Wait(); err != nil {
		errors = append(errors, fmt.Errorf("%q failed with: %v", c.cmd.Path, err))
	}
	return multierr.Combine(errors...)
}
198572
func (m *FileMutex) Close() error {
	if err := syscall.Flock(m.fd, syscall.LOCK_UN); err != nil {
		return err
	}
	return syscall.Close(m.fd)
}
311618
func (m *Memory) Close() error {
	m.cancel()
	m.Lock()
	defer m.Unlock()
	m.buf.Close()
	return nil
}
1237728
func close(f io.Closer) {
	err := f.Close()
	if err != nil {
		log.Warnf("Failed to close the file/writer/reader. %v", err)
	}
}
359894
func (provider *Provider) Close() {
	provider.idStore.close()
	provider.ledgerStoreProvider.Close()
	provider.vdbProvider.Close()
	provider.historydbProvider.Close()
	provider.bookkeepingProvider.Close()
	provider.configHistoryMgr.Close()
}
91343
func (acc *Accumulator) Close() error {
	close(acc.stopSources)
	acc.sources.Wait()

	acc.tearDownPools()

	var err error
	if acc.seedFile != nil {
		acc.stopAutoSave <- true
		err = acc.writeSeedFile()
		acc.seedFile.Close()
		acc.seedFile = nil
	}

	// Reset the underlying PRNG to ensure that (1) the Accumulator
	// cannot be used any more after Close() has been called and (2)
	// information about the key is not retained in memory
	// indefinitely.
	acc.gen.reset()

	return err
}
1306885
func (d *Daemon) Close() {
	if d.policyTrigger != nil {
		d.policyTrigger.Shutdown()
	}
	d.nodeDiscovery.Close()
}
701301
func (m *FileMutex) Close() error {
	var ol syscall.Overlapped
	if err := unlockFileEx(m.fd, 0, 1, 0, &ol); err != nil {
		return err
	}
	return syscall.Close(m.fd)
}
999615
func (f *fileSystem) Close() error {
	if f.temporary {
		return os.RemoveAll(f.root)
	}
	return nil
}
1322032
func (l *SingleFileStore) Close() error {
	l.mu.Lock()
	defer l.mu.Unlock()
	return l.close()
}
1035673
func (v *VTY) Close() error {
	if v.conn == nil {
		return fmt.Errorf("No connection established")
	}
	err := v.conn.Close()
	v.conn = nil
	return err
}
897967
func (s *TrapServer) Close() error {
	s.servingMu.Lock()
	s.serving = false
	s.servingMu.Unlock()
	return s.transport.Close(nil)
}
1068
func (mux *Multiplexer) Close() {
	safeclose.Close(
		mux.Consumer,
		mux.hashSyncProducer,
		mux.hashAsyncProducer,
		mux.manSyncProducer,
		mux.manAsyncProducer)
}
1095027
func (c *RPCClient) Close() error {
	close(c.streamTimeout)
	if raw, ok := c.MvccStore.(io.Closer); ok {
		return raw.Close()
	}
	return nil
}