// Close will clear and release all of the SWbemServices resources
962058
func (s *SWbemServices) Close() error {
	s.lQueryorClose.Lock()
	if s == nil || s.sWbemLocatorIDispatch == nil {
		s.lQueryorClose.Unlock()
		return fmt.Errorf("SWbemServices is not Initialized")
	}
	if s.queries == nil {
		s.lQueryorClose.Unlock()
		return fmt.Errorf("SWbemServices has been closed")
	}
	//fmt.Println("Close: sending close request")
	var result error
	ce := make(chan error)
	s.closeError = ce //Race condition if multiple callers to close. May need to lock here
	close(s.queries)  //Tell background to shut things down
	s.lQueryorClose.Unlock()
	err, ok := <-ce
	if ok {
		result = err
	}
	//fmt.Println("Close: finished")
	return result
}
171084
func (spi *SPIDevice) Close() error {
	err := spi.file.Close()
	if err != nil {
		return fmt.Errorf("Error closing spi", err)
	}
	return nil
}
348814
func (es *EventSource) Close() {
	es.locker.Lock()
	defer es.locker.Unlock()
	if !es.closed {
		es.conn.Close()
		close(es.closeNotify)
		es.closed = true
	}
}
484951
func (r *Rabbus) Close() error {
	err := r.Amqp.Close()
	close(r.emit)
	close(r.emitOk)
	close(r.emitErr)
	close(r.reconn)
	return err
}
620392
func (res *Resource) Close() {
	res.stmu.Lock()
	defer res.stmu.Unlock()

	res.chmu.Lock()
	if res.ch != nil {
		close(res.ch) // signal any references.
		res.ch = nil  // stop future Acquires
	}
	res.chmu.Unlock()

	res.wg.Wait() // wait for any acquired references
}
165992
func (c *Client) Close() error {
	if err := c.Flush(); err != nil {
		return err
	}
	c.buf = nil
	return c.conn.Close()
}
1236801
func Close() {
	mu.Lock()
	defer mu.Unlock()

	if portfile != "" {
		os.Remove(portfile)
		portfile = ""
	}
	if listener != nil {
		listener.Close()
	}
}
380612
func (w *writeCloseInformer) Close() error {
	err := w.wc.Close()
	close(w.close)
	return err
}
541107
func (s *Session) Close() error {
	var err error
	s.dealloc.Do(func() {
		// Send shutdown events to log and event processor
		s.shutdown <- struct{}{}
		s.shutdown <- struct{}{}
		s.wg.Wait()

		err = spError(C.sp_session_release(s.sp_session))
		s.free()
	})
	return nil
}
401439
func (s *Subscriptions) Close() {
	s.lock.Lock()
	defer s.lock.Unlock()
	if s.closed {
		return
	}
	s.closed = true
	close(s.readyChannel)
	close(s.messageChannel)
}
502737
func (rw rwCloser) Close() error {
	err := rw.ReadCloser.Close()
	if err := rw.WriteCloser.Close(); err != nil {
		return err
	}
	return err
}
1285874
func (wf *WriteFlusher) Close() error {
	wf.closeLock.Lock()
	defer wf.closeLock.Unlock()

	select {
	case <-wf.closed:
		return errWriteFlusherClosed
	default:
		close(wf.closed)
	}
	return nil
}
810479
func (a *Upstream) Close() error {
	close(a.quit)
	if a.ws == nil {
		return nil
	}
	return a.ws.Close()
}
981857
func (s *SeriesSegment) Close() (err error) {
	if e := s.CloseForWrite(); e != nil && err == nil {
		err = e
	}

	if s.data != nil {
		if e := mmap.Unmap(s.data); e != nil && err == nil {
			err = e
		}
		s.data = nil
	}

	return err
}
150871
func (p *Partition) Close() error {
	p.resmu.Lock()
	defer p.resmu.Unlock()

	// Close the resource and wait for any outstanding references.
	p.res.Close()
	p.compactionsWG.Wait()

	// There are now no internal outstanding callers holding a reference
	// so we can acquire this mutex to protect against external callers.
	p.mu.Lock()
	defer p.mu.Unlock()

	return p.close()
}
389096
func (srv *Server) Close() error {
	srv.mu.Lock()
	defer srv.mu.Unlock()
	srv.closeDoneChanLocked()
	err := srv.closeListenersLocked()
	for c := range srv.conns {
		c.Close()
		delete(srv.conns, c)
	}
	return err
}
57544
func (rp *ResourcePool) Close() {
	if rp.idleTimer != nil {
		rp.idleTimer.Stop()
	}
	_ = rp.SetCapacity(0)
}