Author: rhs
Date: Fri May 23 13:36:10 2008
New Revision: 659650

URL: http://svn.apache.org/viewvc?rev=659650&view=rev
Log:
QPID-1064: only set the listeners to None *after* the thread has stopped

Modified:
    incubator/qpid/trunk/qpid/python/qpid/queue.py

Modified: incubator/qpid/trunk/qpid/python/qpid/queue.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/queue.py?rev=659650&r1=659649&r2=659650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/queue.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/queue.py Fri May 23 13:36:10 2008
@@ -60,19 +60,19 @@
     if listener is None and exc_listener is not None:
       raise ValueError("cannot set exception listener without setting 
listener")
 
-    self.listener = listener
-    self.exc_listener = exc_listener
-
     if listener is None:
       if self.thread is not None:
         self.put(Queue.STOP)
         self.thread.join()
         self.thread = None
-    else:
-      if self.thread is None:
-        self.thread = Thread(target = self.run)
-        self.thread.setDaemon(True)
-        self.thread.start()
+
+    self.listener = listener
+    self.exc_listener = exc_listener
+
+    if listener is not None and self.thread is None:
+      self.thread = Thread(target = self.run)
+      self.thread.setDaemon(True)
+      self.thread.start()
 
   def run(self):
     while True:


Reply via email to