// Close cleans up the hook and closes the ETW provider. If the provder was
// registered by etwlogrus, it will be closed as part of `Close`. If the
// provider was passed in, it will not be closed.
9800
func (h *Hook) Close() error {
	if h.closeProvider {
		return h.provider.Close()
	}
	return nil
}
565948
func (s *proxySocket) Close() {
	s.locker.Lock()

	select {
	case <-s.closing:
		s.locker.Unlock()
		return
	default:
	}

	close(s.closing)
	s.listener.Close()

	pairs := s.pairs
	s.pairs = nil

	s.locker.Unlock()

	// Immediately close all connection pairs for which cascading close was
	// requested in Accept.
	for _, pair := range pairs {
		pair.Rx.Close()
	}
}
884603
func (f *followDatastoreFile) Close() error {
	f.o.Do(func() { close(f.c) })
	return nil
}
545691
func (c *Client) Close() error {
	if c.fsHandler != nil {
		return c.fsHandler.Close()
	}
	return nil
}
409893
func (ws *Conn) Close() error {
	err := ws.frameHandler.WriteClose(ws.defaultCloseStatus)
	if err != nil {
		return err
	}
	return ws.rwc.Close()
}
334788
func (c *connection) Close() error {
	c.mu.Lock()
	if c.stopErr == nil {
		c.stopErr = ErrClosed
		close(c.stop)
	}
	c.mu.Unlock()
	return c.rw.Close()
}
502737
func (rw rwCloser) Close() error {
	err := rw.ReadCloser.Close()
	if err := rw.WriteCloser.Close(); err != nil {
		return err
	}
	return err
}
963484
func (lc *LoopbackConn) Close() (err error) {
	lc.wMutex.Lock()
	defer lc.wMutex.Unlock()
	if lc.isClosed {
		return syscall.EINVAL
	}
	lc.isClosed = true
	close(lc.ch)
	return nil
}
1132517
func (w *writer) Close(err error) error {
	w.encoder.Flush()
	if err == nil {
		err = w.encoder.Error()
	}
	w.err = err
	if w.closer != nil {
		return w.closer.Close()
	} else {
		return nil
	}
}
107633
func (conn *Conn) Close() {
	conn.conn.Close()
	conn.closed = true
	if conn.dataConn != nil {
		conn.dataConn.Close()
		conn.dataConn = nil
	}
}
702796
func (p *AuthProxy) Close() error {
	p.o.Stop()
	return p.s.Stop()
}
369269
func (de *DefaultEndpointer) Close() {
	de.instancer.Deregister(de.ch)
	close(de.ch)
}
972982
func (h *BuildHandler) Close() error {
	var result error
	for _, closer := range h.closers {
		err := closer.Close()
		if err != nil {
			result = multierror.Append(result, err)
		}
	}
	return result
}
150484
func (h *Holder) Close() error {
	h.Stats.Close()

	// Notify goroutines of closing and wait for completion.
	close(h.closing)
	h.wg.Wait()

	for _, index := range h.indexes {
		if err := index.Close(); err != nil {
			return errors.Wrap(err, "closing index")
		}
	}

	if h.translateFile != nil {
		if err := h.translateFile.Close(); err != nil {
			return err
		}
	}

	// Reset opened in case Holder needs to be reopened.
	h.opened.mu.Lock()
	h.opened.ch = make(chan struct{})
	h.opened.mu.Unlock()

	return nil
}
38769
func (c *Client) Close() error {
	close(c.quit)
	c.wg.Wait()
	return c.db.Close()
}
151782
func (p *Plugin) Close() error {
	p.cancel()
	p.wg.Wait()

	return nil
}
99408
func (d *DL) Close() error {
	if d.handle != nil {
		d.mu.Lock()
		defer d.mu.Unlock()
		if d.handle != nil {
			mu.Lock()
			defer mu.Unlock()
			if C.dlclose(d.handle) != 0 {
				return dlerror()
			}
			d.handle = nil
		}
	}
	return nil
}