Author: clebert.suconic(a)jboss.com
Date: 2009-11-24 10:07:34 -0500 (Tue, 24 Nov 2009)
New Revision: 8392
Modified:
trunk/src/main/org/hornetq/core/journal/impl/TransactionCallback.java
Log:
Fixing race on blocking commits & fixing hanging tests
Modified: trunk/src/main/org/hornetq/core/journal/impl/TransactionCallback.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/TransactionCallback.java 2009-11-24
03:50:27 UTC (rev 8391)
+++ trunk/src/main/org/hornetq/core/journal/impl/TransactionCallback.java 2009-11-24
15:07:34 UTC (rev 8392)
@@ -49,8 +49,11 @@
countLatch.down();
if (++done == up && delegateCompletion != null)
{
- delegateCompletion.done();
+ final IOAsyncTask delegateToCall = delegateCompletion;
+ // We need to set the delegateCompletion to null first or blocking commits could
miss a callback
+ // What would affect mainly tests
delegateCompletion = null;
+ delegateToCall.done();
}
}