summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2015-06-14 09:24:39 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2015-06-14 09:24:39 -0700
commitfcfc210a6d8e1c51dc092ae7f1d93829a67bdd31 (patch)
tree803abe237d47d4aabfdfdc820abec9b31f0f999c /gnuradio-runtime/python/gnuradio
parent52ca92933e437f613eac1536104bac72c01e8a29 (diff)
parent7ee2f91d3c51498a6d1923fb47f47b882c9a77e5 (diff)
Merge branch 'master' into next
Diffstat (limited to 'gnuradio-runtime/python/gnuradio')
-rw-r--r--gnuradio-runtime/python/gnuradio/gr/top_block.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gr/top_block.py b/gnuradio-runtime/python/gnuradio/gr/top_block.py
index f449d98489..2efcbd9aae 100644
--- a/gnuradio-runtime/python/gnuradio/gr/top_block.py
+++ b/gnuradio-runtime/python/gnuradio/gr/top_block.py
@@ -63,11 +63,13 @@ class _top_block_waiter(_threading.Thread):
top_block_wait_unlocked(self.tb)
self.event.set()
- def wait(self):
+ def wait(self, handle_sigint=True):
try:
- while not self.event.isSet():
- self.event.wait(0.100)
+ while not self.event.wait(0.1):
+ pass
except KeyboardInterrupt:
+ if not handle_sigint:
+ raise
self.tb.stop()
self.wait()
@@ -98,6 +100,7 @@ class top_block(hier_block2):
"""
# not calling hier_block2.__init__, we set our own _impl
self._impl = top_block_swig(name)
+ self.handle_sigint = True
def start(self, max_noutput_items=10000000):
"""
@@ -128,7 +131,7 @@ class top_block(hier_block2):
"""
Wait for the flowgraph to finish running
"""
- _top_block_waiter(self._impl).wait()
+ _top_block_waiter(self._impl).wait(self.handle_sigint)
def dot_graph(self):
"""