summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-10-09 13:11:41 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-10-09 13:11:41 +0000
commit8ea48d45d020ef78026c868a3aba15cc832eaf0f (patch)
treeef4b0c8688620bc50678bf155091f59a799b6f53
parentc43a4d0bffd5cfba569d5264aab284b1d6c653ae (diff)
downloadqpid-python-8ea48d45d020ef78026c868a3aba15cc832eaf0f.tar.gz
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
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQSession.java8
1 files changed, 4 insertions, 4 deletions
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