public override object Clone() { IndexInput clone = null; try { _fileMutex.WaitOne(); clone = new SecureStoreIndexInput(this); } finally { _fileMutex.ReleaseMutex(); } return clone; }
private SecureStoreIndexInput(SecureStoreIndexInput cloneInput) { _fileMutex = BlobMutexManager.GrabMutex(cloneInput._name); _fileMutex.WaitOne(); try { _directory = cloneInput._directory; _cache = cloneInput._cache; _name = cloneInput._name; _indexInput = cloneInput._indexInput.Clone() as IndexInput; } catch (Exception) { // sometimes we get access denied on the 2nd stream...but not always. I haven't tracked it down yet // but this covers our tail until I do LeoTrace.WriteLine(String.Format("Falling back to memory clone for {0}", cloneInput._name)); } finally { _fileMutex.ReleaseMutex(); } }