// closeObjects and return a bool when finished on a channel.
160836
func (d *Death) closeObjects(closer closer, done chan<- closer) {
	err := closer.C.Close()
	if err != nil {
		d.log.Error(err)
		closer.Err = err
	}
	done <- closer
}
390104
func (s *SocketHub) Close() {
	if s.closed {
		return
	}
	s.closed = true
	close(s.closer)
}
332411
func (b *CloseBroadcaster) Close() error {
	b.Do(func() {
		close(b.C)
	})
	return nil
}
599698
func (p *MediaPlaylist) Close() {
	if p.buf.Len() > 0 {
		p.buf.WriteString("#EXT-X-ENDLIST\n")
	}
	p.Closed = true
}
1096794
func (cm *CIDRMap) Close() error {
	if cm == nil {
		return nil
	}
	return bpf.ObjClose(cm.Fd)
}
277564
func (w *Window) Close() bool {
	if !w.CloseAllViews() {
		return false
	}
	GetEditor().remove(w)

	return true
}
729720
func (s *ObjectScanner) Close() error {
	if s == nil {
		return nil
	}

	s.reset()
	s.gitobj.Close()

	return nil
}
702573
func (b *Bucket) close() {
	if b.channelQuit != nil {
		close(b.channelQuit)
		b.channelQuit = nil
	}
}
1196544
func (reg *WatchDataReg) Close() error {
	reg.adapter.access.Lock()
	defer reg.adapter.access.Unlock()

	for _, sub := range reg.adapter.subscriptions {
		// subscription should have also change channel, otherwise it is not registered
		// for change events
		if sub.ChangeChan != nil && sub.CloseChan != nil {
			// close the channel with all goroutines under subscription
			safeclose.Close(sub.CloseChan)
		}
	}

	delete(reg.adapter.subscriptions, reg.ResyncName)

	return nil
}
334695
func (r *Receiver) Close() error {
	r.cl.Lock()
	defer r.cl.Unlock()
	if r.cl.client == nil {
		return ErrNotConnected
	}
	close(r.chanClose)
	return r.cl.Close()
}
954602
func (api *Client) CloseIMChannel(channel string) (bool, bool, error) {
	return api.CloseIMChannelContext(context.Background(), channel)
}
397018
func (r *readSubscribeToShardEventStream) Close() error {
	r.closeOnce.Do(r.safeClose)

	return r.Err()
}
1132632
func (g *GetObjectReader) Close() error {
	// sync.Once is used here to ensure that Close() is
	// idempotent.
	g.once.Do(func() {
		for i := len(g.cleanUpFns) - 1; i >= 0; i-- {
			g.cleanUpFns[i]()
		}
	})
	return nil
}
1147662
func (o *LargeObject) Close() error {
	_, err := o.lo.fp.CallFn("lo_close", []fpArg{fpIntArg(o.fd)})
	return err
}
1189518
func (f *DefaultPooledObjectFactory) DestroyObject(ctx context.Context, object *PooledObject) error {
	if f.destroy != nil {
		return f.destroy(ctx, object)
	}
	return nil
}
664320
func (pool *ObjectPool) IsClosed() bool {
	pool.closeLock.Lock()
	defer pool.closeLock.Unlock()
	// in java commons pool, closed is volatile, golang has not volatile, so use mutex to avoid data race
	return pool.closed
}
617350
func (s *ObjectStorage) Close() error {
	var firstError error
	if s.options.KeepDescriptors || s.options.MaxOpenDescriptors > 0 {
		for _, packfile := range s.packfiles {
			err := packfile.Close()
			if firstError == nil && err != nil {
				firstError = err
			}
		}
	}

	s.packfiles = nil
	s.dir.Close()

	return firstError
}