// Close closes underlying file and signals all readers to stop.
193730
func (w *LogFile) Close() error {
	w.mu.Lock()
	defer w.mu.Unlock()
	if w.closed {
		return nil
	}
	if err := w.f.Close(); err != nil {
		return err
	}
	w.closed = true
	return nil
}
1154041
func (f *File) Close() error {
	f.buf = nil
	f.dirIndex = 0

	return nil
}
1027334
func (r *Reader) Close() error {
	var err error
	if r.hasMappedFile {
		runtime.SetFinalizer(r, nil)
		r.hasMappedFile = false
		err = munmap(r.buffer)
	}
	r.buffer = nil
	return err
}
1322032
func (l *SingleFileStore) Close() error {
	l.mu.Lock()
	defer l.mu.Unlock()
	return l.close()
}
766752
func (fsi *fsIOPool) Close(path string) error {
	fsi.Lock()
	defer fsi.Unlock()

	if err := checkPathLength(path); err != nil {
		return err
	}

	// Pop readers from path.
	rlkFile, ok := fsi.readersMap[path]
	if !ok {
		return nil
	}

	// Close the reader.
	rlkFile.Close()

	// If the file is closed, remove it from the reader pool map.
	if rlkFile.IsClosed() {

		// Purge the cached lock path from map.
		delete(fsi.readersMap, path)
	}

	// Success.
	return nil
}
1087881
func (s *Stream) Close() error {
	if !s.closed {
		s.closed = true
		err := newError(C.Pa_CloseStream(s.paStream))
		delStream(s)
		return err
	}
	return nil
}
289094
func (fs *FileStore) Close() error {
	fs.Lock()
	if fs.closed {
		fs.Unlock()
		return nil
	}
	fs.closed = true

	err := fs.genericStore.close()

	fm := fs.fm
	lockFile := fs.lockFile
	fs.Unlock()

	if fm != nil {
		if fmerr := fm.close(); fmerr != nil && err == nil {
			err = fmerr
		}
	}
	if lockFile != nil {
		err = util.CloseFile(err, lockFile)
	}
	return err
}
698011
func (h *Handler) Close() error {
	close(h.logHandlerChan)
	h.wg.Wait()
	return h.file.Close()
}
884603
func (f *followDatastoreFile) Close() error {
	f.o.Do(func() { close(f.c) })
	return nil
}
1303992
func (l *FileLog) Close() error {
	l.Lock()
	defer l.Unlock()

	var err error
	if l.file != nil {
		err = l.file.Close()
		l.file = nil
	}
	return err
}
865284
func (w *Writer) Close() error {
	defer w.Done()
	if c, ok := w.Writer.(io.Closer); ok {
		return c.Close()
	}
	return nil
}
36231
func (r *translateFileReader) Close() error {
	r.once.Do(func() { close(r.closing) })

	if r.file != nil {
		return r.file.Close()
	}
	return nil
}
150980
func (t *Tar) Close() error {
	var err error
	if t.tr != nil {
		t.tr = nil
	}
	if t.tw != nil {
		tw := t.tw
		t.tw = nil
		err = tw.Close()
	}
	// make sure cleanup of "Reader/Writer wrapper"
	// (say that ten times fast) happens AFTER the
	// underlying stream is closed
	if t.cleanupWrapFn != nil {
		t.cleanupWrapFn()
	}
	return err
}
558393
func (cfp *FsPool) Close() error {
	if cfp.reader != nil {
		err := cfp.reader.Close()
		if err != nil {
			return errors.WithStack(err)
		}

		cfp.reader = nil
		cfp.fileIndex = -1
	}

	return nil
}
1274912
func (xr *Reader) Close() error {
	if xr.err == errClosed {
		return nil
	}
	if xr.err != nil && xr.err != io.EOF {
		return xr.err
	}
	xr.err = errClosed
	return nil
}
290303
func (f *FileWriter) Close() error {
	f.mu.Lock()
	err := f.f.Close()
	f.mu.Unlock()
	return err
}
557316
func (br *BlockReader) Close() error {
	br.closed = true
	if br.conn != nil {
		br.conn.Close()
	}

	return nil
}