diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/driver.py | 1 | ||||
| -rw-r--r-- | python/qpid/messaging.py | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/python/qpid/driver.py b/python/qpid/driver.py index a759588572..fc6481bece 100644 --- a/python/qpid/driver.py +++ b/python/qpid/driver.py @@ -191,6 +191,7 @@ class Driver: 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 diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py index 2bf822b4c8..d755aa5054 100644 --- a/python/qpid/messaging.py +++ b/python/qpid/messaging.py @@ -286,6 +286,7 @@ class Session: 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 @@ class Session: @synchronized def run(self): + self.running = True try: while True: msg = self._get(self._pred) @@ -470,7 +472,7 @@ class Session: 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 @@ class Session: 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 |
