Repository: activemq
Updated Branches:
  refs/heads/master 6f524bfea -> 9ddd162d2


https://issues.apache.org/jira/browse/AMQ-4361 - implement suggestion from Sam 
hendley with thanks, avoid the IllegalMonitorStateException


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/9ddd162d
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/9ddd162d
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/9ddd162d

Branch: refs/heads/master
Commit: 9ddd162d2584f39c8e3b303db91dc43143381ecc
Parents: 6f524bf
Author: gtully <[email protected]>
Authored: Thu Oct 22 15:49:44 2015 +0100
Committer: gtully <[email protected]>
Committed: Thu Oct 22 15:49:44 2015 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/usage/MemoryUsage.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/9ddd162d/activemq-client/src/main/java/org/apache/activemq/usage/MemoryUsage.java
----------------------------------------------------------------------
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 74fb5c3..8c38c2d 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<MemoryUsage> {
                     while (percentUsage >= 100 && isStarted()) {
                         waitForSpaceCondition.await();
                     }
-                    usageLock.readLock().lock();
                 } finally {
                     usageLock.writeLock().unlock();
+                    usageLock.readLock().lock();
                 }
             }
 

Reply via email to