diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java index a96be4a7f..03947d839 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java @@ -418,8 +418,11 @@ public final class DfsBlockCache { private void creditSpace(int credit, DfsStreamKey key) { clockLock.lock(); - getStat(liveBytes, key).addAndGet(-credit); - clockLock.unlock(); + try { + getStat(liveBytes, key).addAndGet(-credit); + } finally { + clockLock.unlock(); + } } @SuppressWarnings("unchecked")