[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/10: runtime: add flag to wrapped top_blo
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/10: runtime: add flag to wrapped top_block to control SIGINT handling in wait() |
Date: |
Sun, 14 Jun 2015 16:34:15 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit bc3fb9ed4ea3b51e9f450c7f7ec007d718bca58a
Author: Sebastian Koslowski <address@hidden>
Date: Fri May 29 15:42:51 2015 +0200
runtime: add flag to wrapped top_block to control SIGINT handling in wait()
---
gnuradio-runtime/python/gnuradio/gr/top_block.py | 11 +++++++----
1 file 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 f449d98..2efcbd9 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):
"""
- [Commit-gnuradio] [gnuradio] branch master updated (1dc65e1 -> 7ee2f91), git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 06/10: Merge remote-tracking branch 'skoslowski/top_block_wait', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 09/10: Merge branch 'maint', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 01/10: runtime: add flag to wrapped top_block to control SIGINT handling in wait(),
git <=
- [Commit-gnuradio] [gnuradio] 08/10: Merge remote-tracking branch 'mbr0wn/uhd/gpios', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 07/10: Merge remote-tracking branch 'drmpeg/dtv-coverity-cleanup', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 05/10: uhd: Expose GPIO functions through SWIG, git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 10/10: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 03/10: grc: add <flags> to blocks dtd (<throttle> still supported), git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 04/10: grc: Added ability to bypass blocks (Suggested by Chris Headley)., git, 2015/06/14
- [Commit-gnuradio] [gnuradio] 02/10: gr-dtv: Clean up minor Coverity Scan issues., git, 2015/06/14