diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2008-05-23 20:36:10 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2008-05-23 20:36:10 +0000 |
| commit | fdc891389a4b75b73249c88b195cebead020af74 (patch) | |
| tree | e924be8e07252f95a9bd73fc3517ec048d1c067d /qpid/python | |
| parent | 6098815e59e2da90883ce6fb4d9f85354d6425f5 (diff) | |
| download | qpid-python-fdc891389a4b75b73249c88b195cebead020af74.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@659650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/qpid/queue.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/qpid/python/qpid/queue.py b/qpid/python/qpid/queue.py index 830ea6060d..c9f4d1d1d0 100644 --- a/qpid/python/qpid/queue.py +++ b/qpid/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: |
