Merge "ReceiveCommits: Don't synchronize on non-final fields"

This commit is contained in:
David Pursehouse
2015-12-16 02:01:26 +00:00
committed by Gerrit Code Review

View File

@@ -1755,9 +1755,7 @@ public class ReceiveCommits {
insertChange(threadLocalDb);
}
}
synchronized (newProgress) {
newProgress.update(1);
}
synchronizedIncrement(newProgress);
return null;
}
}));
@@ -2174,9 +2172,7 @@ public class ReceiveCommits {
}
}
} finally {
synchronized (replaceProgress) {
replaceProgress.update(1);
}
synchronizedIncrement(replaceProgress);
}
}
}));
@@ -2846,4 +2842,10 @@ public class ReceiveCommits {
private static boolean isConfig(final ReceiveCommand cmd) {
return cmd.getRefName().equals(RefNames.REFS_CONFIG);
}
private static void synchronizedIncrement(Task p) {
synchronized (p) {
p.update(1);
}
}
}