on close() don't storeState in synchronized block - as it can lead to a deadlock

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@516007 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2007-03-08 10:58:41 +00:00
parent da13d596a5
commit 8ad375ff60
1 changed files with 13 additions and 11 deletions

View File

@ -265,18 +265,20 @@ public final class AsyncDataManager {
return (DataFile) dataFile.getNext(); return (DataFile) dataFile.getNext();
} }
public synchronized void close() throws IOException{ public void close() throws IOException{
if( !started ) { synchronized(this){
return; if(!started){
} return;
Scheduler.cancel(cleanupTask); }
accessorPool.close(); Scheduler.cancel(cleanupTask);
storeState(false); accessorPool.close();
appender.close(); }
storeState(false);
appender.close();
fileMap.clear(); fileMap.clear();
controlFile.unlock(); controlFile.unlock();
controlFile.dispose(); controlFile.dispose();
started=false; started=false;
} }
private synchronized void cleanup() { private synchronized void cleanup() {