Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ private void writeHeader() throws IOException {
}

@Override
public void write(int b) throws IOException {
public synchronized void write(int b) throws IOException {
super.write((int) EncodedFileUtil.encodeByte((byte) b, type));
encodedDataLength++;
}

@Override
public void write(byte[] b,
public synchronized void write(byte[] b,
int off,
int len)
throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,7 @@ public Optional<OsAccount> getLocalLinuxOsAccount(String uid, String loginName,
}
}

private final Object osAccountLockObj = new Object();
/**
* Adds a rows to the tsk_os_account_attributes table for the given set of
* attribute.
Expand All @@ -1397,7 +1398,7 @@ public Optional<OsAccount> getLocalLinuxOsAccount(String uid, String loginName,
*/
public void addExtendedOsAccountAttributes(OsAccount account, List<OsAccountAttribute> accountAttributes) throws TskCoreException {

synchronized (account) { // synchronized to prevent multiple threads trying to add osAccount attributes concurrently to the same osAccount.
synchronized (osAccountLockObj) { // synchronized to prevent multiple threads trying to add osAccount attributes concurrently to the same osAccount.
db.acquireSingleUserCaseWriteLock();

try (CaseDbConnection connection = db.getConnection()) {
Expand Down
1 change: 0 additions & 1 deletion bindings/java/test/org/sleuthkit/datamodel/HashDbTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public static Collection<Object[]> testImageData() {

for (Object imagePaths : DataModelTestSuite.getImagePaths()) {
data.add(new Object[]{imagePaths});
break;
}
return data;
}
Expand Down
Loading