func (pool *ReaderPool) dropAll(doSave bool) error {
	pool.Lock()  
	defer pool.Unlock()
	var priorE error
	for len(pool.readerMap) > 0 {
		for k, rld := range pool.readerMap {
			if doSave {
				ok, err := rld.writeLiveDocs(pool.owner.directory)
				if err != nil {
					return err
				}
				if ok {
					assert(pool.infoIsLive(rld.info))
					err = pool.owner.checkpointNoSIS()
					if err != nil {
						return err
					}
				}
			}
			delete(pool.readerMap, k)
			err := rld.dropReaders()
			if err != nil {
				if doSave {
					return err
				}
				if priorE == nil {
					priorE = err
				}
			}
		}
	}
	assert(len(pool.readerMap) == 0)
	return priorE
}
Remove all our references to readers, and commits any pending changes.
package index
import (
	. "github.com/balzaczyy/golucene/core/codec/spi"
	"strings"
	"sync"
)
type ReaderPool struct {
	owner *IndexWriter
	sync.Locker
	readerMap map[*SegmentCommitInfo]*ReadersAndUpdates
}
func newReaderPool(owner *IndexWriter) *ReaderPool {
	return &ReaderPool{
		owner:     owner,
		Locker:    &sync.Mutex{},
		readerMap: make(map[*SegmentCommitInfo]*ReadersAndUpdates),
	}
}
func (pool *ReaderPool) infoIsLive(info *SegmentCommitInfo) bool {
	panic("not implemented yet")
}
func (pool *ReaderPool) drop(info *SegmentCommitInfo) error {
	pool.Lock()
	defer pool.Unlock()
	panic("not implemented yet")
}
func (pool *ReaderPool) release(rld *ReadersAndUpdates) error {
	panic("not implemented yet")
}
func (pool *ReaderPool) Close() error {
	return pool.dropAll(false)
}