- Faster VMTransport shutdown by avoiding a potential deadlock

- Better connection shutdown.


git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@561180 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2007-07-30 23:11:24 +00:00
parent f90c62c640
commit 5ad4732038
2 changed files with 6 additions and 1 deletions

View File

@ -930,6 +930,7 @@ public class TransportConnection implements Service,Connection,Task,CommandVisit
// from the broker.
if (!broker.isStopped()) {
connectionStates=listConnectionStates();
for (TransportConnectionState cs : connectionStates) {
cs.getContext().getStopping().set(true);
try {

View File

@ -168,16 +168,20 @@ public class VMTransport implements Transport,Task{
}
public void stop() throws Exception{
TaskRunner tr=null;
synchronized(mutex) {
if(!disposed){
started=false;
disposed=true;
if(taskRunner!=null){
taskRunner.shutdown(1000);
tr = taskRunner;
taskRunner=null;
}
}
}
if( tr !=null ) {
tr.shutdown(1000);
}
}
public Object narrow(Class target){