summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-04-18 18:09:38 +0000
committerRafael H. Schloming <rhs@apache.org>2009-04-18 18:09:38 +0000
commit01e220c596176c22cdec67797925952175f5f79e (patch)
tree712a623885d4eaf89503f0d2c4e3b0b745966b04
parente5580c600206036f37eb9f4cb0ffe4e3973e483b (diff)
downloadqpid-python-01e220c596176c22cdec67797925952175f5f79e.tar.gz
used timed wait to improve debugability
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@766369 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/queue.py4
-rw-r--r--qpid/python/qpid/util.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/qpid/python/qpid/queue.py b/qpid/python/qpid/queue.py
index c9f4d1d1d0..63a7684843 100644
--- a/qpid/python/qpid/queue.py
+++ b/qpid/python/qpid/queue.py
@@ -63,7 +63,9 @@ class Queue(BaseQueue):
if listener is None:
if self.thread is not None:
self.put(Queue.STOP)
- self.thread.join()
+ # loop and timed join permit keyboard interrupts to work
+ while self.thread.isAlive():
+ self.thread.join(3)
self.thread = None
self.listener = listener
diff --git a/qpid/python/qpid/util.py b/qpid/python/qpid/util.py
index bb7f5090df..f4b613f4e5 100644
--- a/qpid/python/qpid/util.py
+++ b/qpid/python/qpid/util.py
@@ -50,7 +50,9 @@ def wait(condition, predicate, timeout=None):
start = time.time()
while not predicate():
if timeout is None:
- condition.wait()
+ # using the timed wait prevents keyboard interrupts from being
+ # blocked while waiting
+ condition.wait(3)
elif passed < timeout:
condition.wait(timeout - passed)
else: