qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1666241 - /qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java
Date Thu, 12 Mar 2015 16:29:47 GMT
Author: rgodfrey
Date: Thu Mar 12 16:29:47 2015
New Revision: 1666241

URL: http://svn.apache.org/r1666241
Log:
QPID-6447 : [Java AMQP 1.0 Client] Use endpoint lock in Transaction Controller

Modified:
    qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java

Modified: qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java?rev=1666241&r1=1666240&r2=1666241&view=diff
==============================================================================
--- qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java
(original)
+++ qpid/trunk/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/TransactionController.java
Thu Mar 12 16:29:47 2015
@@ -113,13 +113,14 @@ public class TransactionController imple
 
     private void waitForResponse() throws LinkDetachedException
     {
-        synchronized (this)
+        final Object lock = _endpoint.getLock();
+        synchronized (lock)
         {
             while(!_received && !_endpoint.isDetached())
             {
                 try
                 {
-                    wait();
+                    lock.wait();
                 }
                 catch (InterruptedException e)
                 {
@@ -133,12 +134,16 @@ public class TransactionController imple
         }
     }
 
-    private synchronized void remoteDetached(Detach detach)
+    private void remoteDetached(Detach detach)
     {
-        if(detach != null && detach.getError() != null)
+        final Object lock = _endpoint.getLock();
+        synchronized (lock)
         {
-            _error = detach.getError();
-            notifyAll();
+            if (detach != null && detach.getError() != null)
+            {
+                _error = detach.getError();
+                lock.notifyAll();
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message