static IndexReaderPtr refreshReader(IndexReaderPtr reader) { IndexReaderPtr oldReader = reader; reader = reader->reopen(); if (reader != oldReader) oldReader->close(); return reader; }
IndexReaderPtr TranslationMemoryImpl::Reader() { std::lock_guard<std::mutex> guard(m_readerMutex); if ( m_reader ) m_reader = m_reader->reopen(); else m_reader = IndexReader::open(m_dir, true); return m_reader; }