Changeset 8928
- Timestamp:
- 07/17/08 15:11:38
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gnuradio/branches/features/mp-sched/gnuradio-core/src/python/gnuradio/gr/top_block.py
r6669 r8928 22 22 from gnuradio_swig_python import top_block_swig, \ 23 23 top_block_wait_unlocked, top_block_run_unlocked 24 25 #import gnuradio.gr.gr_threading as _threading 26 import gr_threading as _threading 27 28 29 # 30 # There is no problem that can't be solved with an additional 31 # level of indirection... 32 # 33 # This kludge allows ^C to interrupt top_block.run and top_block.wait 34 # 35 class _top_block_waiter(_threading.Thread): 36 def __init__(self, tb): 37 _threading.Thread.__init__(self) 38 self.setDaemon(1) 39 self.tb = tb 40 self.event = _threading.Event() 41 self.start() 42 43 def run(self): 44 top_block_wait_unlocked(self.tb) 45 self.event.set() 46 47 def wait(self): 48 while True: 49 self.event.wait(0.100) 50 24 51 25 52 # … … 49 76 50 77 def run(self): 51 top_block_run_unlocked(self._tb) 78 self.start() 79 self.wait() 52 80 53 81 def wait(self): 54 top_block_wait_unlocked(self._tb) 82 _top_block_waiter(self._tb).wait() 83 55 84 56 85 # FIXME: these are duplicated from hier_block2.py; they should really be implemented
