qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject svn commit: r811350 - in /qpid/trunk/qpid/python/qpid: driver.py messaging.py
Date Fri, 04 Sep 2009 11:33:32 GMT
Author: rhs
Date: Fri Sep  4 11:33:31 2009
New Revision: 811350

URL: http://svn.apache.org/viewvc?rev=811350&view=rev
Log:
fixed the wait logic for session close

Modified:
    qpid/trunk/qpid/python/qpid/driver.py
    qpid/trunk/qpid/python/qpid/messaging.py

Modified: qpid/trunk/qpid/python/qpid/driver.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/driver.py?rev=811350&r1=811349&r2=811350&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/driver.py (original)
+++ qpid/trunk/qpid/python/qpid/driver.py Fri Sep  4 11:33:31 2009
@@ -191,6 +191,7 @@
     if ssn.closing:
       _ssn.close()
       del self._attachments[ssn]
+      ssn.closed = True
 
   def _exchange_query(self, ssn, address):
     # XXX: auto sync hack is to avoid deadlock on future

Modified: qpid/trunk/qpid/python/qpid/messaging.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/messaging.py?rev=811350&r1=811349&r2=811350&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/messaging.py (original)
+++ qpid/trunk/qpid/python/qpid/messaging.py Fri Sep  4 11:33:31 2009
@@ -286,6 +286,7 @@
     self.closed = False
 
     self._lock = connection._lock
+    self.running = True
     self.thread = Thread(target = self.run)
     self.thread.setDaemon(True)
     self.thread.start()
@@ -460,6 +461,7 @@
 
   @synchronized
   def run(self):
+    self.running = True
     try:
       while True:
         msg = self._get(self._pred)
@@ -470,7 +472,7 @@
           if self._peek(self._pred) is None:
             self.connection._waiter.notifyAll()
     finally:
-      self.closed = True
+      self.running = False
       self.connection._waiter.notifyAll()
 
   @synchronized
@@ -483,7 +485,7 @@
 
     self.closing = True
     self._wakeup()
-    self._ewait(lambda: self.closed)
+    self._ewait(lambda: self.closed and not self.running)
     while self.thread.isAlive():
       self.thread.join(3)
     self.thread = None



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message