import java.io.EOFException;
import java.io.File;
import java.io.IOException;
+import java.io.InterruptedIOException;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel.MapMode;
packFile.getPath()));
}
loadedIdx = idx;
+ } catch (InterruptedIOException e) {
+ // don't invalidate the pack, we are interrupted from another thread
+ throw e;
} catch (IOException e) {
invalid = true;
throw e;
length = fd.length();
onOpenPack();
}
+ } catch (InterruptedIOException e) {
+ // don't invalidate the pack, we are interrupted from another thread
+ openFail(false);
+ throw e;
} catch (IOException ioe) {
- openFail();
+ openFail(true);
throw ioe;
} catch (RuntimeException re) {
- openFail();
+ openFail(true);
throw re;
} catch (Error re) {
- openFail();
+ openFail(true);
throw re;
}
}
- private void openFail() {
+ private void openFail(boolean invalidate) {
activeWindows = 0;
activeCopyRawData = 0;
- invalid = true;
+ invalid = invalidate;
doClose();
}