activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r516007 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
Date Thu, 08 Mar 2007 10:58:42 GMT
Author: rajdavies
Date: Thu Mar  8 02:58:41 2007
New Revision: 516007

URL: http://svn.apache.org/viewvc?view=rev&rev=516007
Log:
on close() don't storeState in synchronized block - as it can lead to a deadlock

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java?view=diff&rev=516007&r1=516006&r2=516007
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/kaha/impl/async/AsyncDataManager.java
Thu Mar  8 02:58:41 2007
@@ -265,18 +265,20 @@
 		return (DataFile) dataFile.getNext();
 	}
 
-    public synchronized void close() throws IOException{
-    	if( !started ) {
-    		return;
-    	}
-    	Scheduler.cancel(cleanupTask);
-    	accessorPool.close();
-    	storeState(false);
-    	appender.close();
+    public void close() throws IOException{
+        synchronized(this){
+            if(!started){
+                return;
+            }
+            Scheduler.cancel(cleanupTask);
+            accessorPool.close();
+        }
+        storeState(false);
+        appender.close();
         fileMap.clear();
-    	controlFile.unlock();
-    	controlFile.dispose();
-    	started=false;
+        controlFile.unlock();
+        controlFile.dispose();
+        started=false;
     }
 
 	private synchronized void cleanup() {



Mime
View raw message