java: public synchronized DirectoryReader getIndexReader() {if (indexReader != null) {indexReader.incRef();}return indexReader;}
C#: public virtual DirectoryReader GetIndexReader(){lock (this){if (indexReader != null){indexReader.IncRef();}return indexReader;}}