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();
}
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() {