From 9ddd162d2584f39c8e3b303db91dc43143381ecc Mon Sep 17 00:00:00 2001 From: gtully Date: Thu, 22 Oct 2015 15:49:44 +0100 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-4361 - implement suggestion from Sam hendley with thanks, avoid the IllegalMonitorStateException --- .../src/main/java/org/apache/activemq/usage/MemoryUsage.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/usage/MemoryUsage.java b/activemq-client/src/main/java/org/apache/activemq/usage/MemoryUsage.java index 74fb5c38a8..8c38c2dc02 100755 --- a/activemq-client/src/main/java/org/apache/activemq/usage/MemoryUsage.java +++ b/activemq-client/src/main/java/org/apache/activemq/usage/MemoryUsage.java @@ -74,9 +74,9 @@ public class MemoryUsage extends Usage { while (percentUsage >= 100 && isStarted()) { waitForSpaceCondition.await(); } - usageLock.readLock().lock(); } finally { usageLock.writeLock().unlock(); + usageLock.readLock().lock(); } }