Skip to content
Snippets Groups Projects
Unverified Commit be51ce5d authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #1283 from APriestman/4036_addReadWriteLock

Add read and write locks to prevent the tsk data structures from bein…
parents 1400f597 9782ccb0
No related branches found
No related tags found
No related merge requests found
...@@ -206,7 +206,7 @@ long getFileHandle() { ...@@ -206,7 +206,7 @@ long getFileHandle() {
*/ */
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
protected int readInt(byte[] buf, long offset, long len) throws TskCoreException { protected synchronized int readInt(byte[] buf, long offset, long len) throws TskCoreException {
if (offset == 0 && size == 0) { if (offset == 0 && size == 0) {
//special case for 0-size file //special case for 0-size file
return 0; return 0;
...@@ -301,15 +301,10 @@ public synchronized List<String> getMetaDataText() throws TskCoreException { ...@@ -301,15 +301,10 @@ public synchronized List<String> getMetaDataText() throws TskCoreException {
*/ */
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public void close() { public synchronized void close() {
if (fileHandle != 0) { if (fileHandle != 0) {
synchronized (this) { SleuthkitJNI.closeFile(fileHandle);
//need to recheck the handle after unlock fileHandle = 0;
if (fileHandle != 0) {
SleuthkitJNI.closeFile(fileHandle);
fileHandle = 0;
}
}
} }
} }
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment