summaryrefslogtreecommitdiff
path: root/python/qpid/queue.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-05-23 20:36:10 +0000
committerRafael H. Schloming <rhs@apache.org>2008-05-23 20:36:10 +0000
commit52833097fb1737316c76822bf7e6dda31dec3433 (patch)
tree285f71cb2823b0ac8425bd219cb0b2ad41c2505b /python/qpid/queue.py
parentf09f774813043aa1abc696c4fc21a49928334978 (diff)
downloadqpid-python-52833097fb1737316c76822bf7e6dda31dec3433.tar.gz
QPID-1064: only set the listeners to None *after* the thread has stopped
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@659650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/queue.py')
-rw-r--r--python/qpid/queue.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/qpid/queue.py b/python/qpid/queue.py
index 830ea6060d..c9f4d1d1d0 100644
--- a/python/qpid/queue.py
+++ b/python/qpid/queue.py
@@ -60,19 +60,19 @@ class Queue(BaseQueue):
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: