From 8ea48d45d020ef78026c868a3aba15cc832eaf0f Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Tue, 9 Oct 2007 13:11:41 +0000 Subject: Qpid-626 : Patch provided by Aidan Skinner to address AMQSession Deadlocks. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@583147 13f79535-47bb-0310-9956-ffa450edef68 --- java/client/src/main/java/org/apache/qpid/client/AMQSession.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'java') diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java index df3b5ed202..fee6690538 100644 --- a/java/client/src/main/java/org/apache/qpid/client/AMQSession.java +++ b/java/client/src/main/java/org/apache/qpid/client/AMQSession.java @@ -519,11 +519,11 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1)); } - synchronized (_messageDeliveryLock) + synchronized (_connection.getFailoverMutex()) { // We must close down all producers and consumers in an orderly fashion. This is the only method // that can be called from a different thread of control from the one controlling the session. - synchronized (_connection.getFailoverMutex()) + synchronized (_messageDeliveryLock) { // Ensure we only try and close an open session. if (!_closed.getAndSet(true)) @@ -577,9 +577,9 @@ public class AMQSession extends Closeable implements Session, QueueSession, Topi */ public void closed(Throwable e) throws JMSException { - synchronized (_messageDeliveryLock) + synchronized (_connection.getFailoverMutex()) { - synchronized (_connection.getFailoverMutex()) + synchronized (_messageDeliveryLock) { // An AMQException has an error code and message already and will be passed in when closure occurs as a // result of a channel close request -- cgit v1.2.1