Ease semaphore acquire out of synchronized block to prevent possible deadlock.

This commit is contained in:
dsyer
2009-10-28 11:24:12 +00:00
parent 2728098b6f
commit ed42745b60

View File

@@ -75,8 +75,9 @@ public class ResultHolderResultQueue implements ResultQueue<ResultHolder> {
* @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++;
}
}