diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java index e282a0dd7..5456e9912 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/support/ResultHolderResultQueue.java @@ -75,8 +75,9 @@ public class ResultHolderResultQueue implements ResultQueue { * @see ResultQueue#expect() */ public void expect() throws InterruptedException { + waits.acquire(); + // Don't acquire the lock in a synchronized block - might deadlock synchronized (lock) { - waits.acquire(); count++; } }