summaryrefslogtreecommitdiff
path: root/gr-blocks/python
diff options
context:
space:
mode:
authorJiří Pinkava <j-pi@seznam.cz>2015-03-15 13:53:45 +0100
committerJiří Pinkava <j-pi@seznam.cz>2015-04-01 14:35:12 +0200
commit43065a682bedd353124bccc1f059d49d27b1cf91 (patch)
tree08b0cc684f99e4b04821b68172a295c7fbaef04c /gr-blocks/python
parent2aded1af5e55dca76c0b9cd4476b083b8fd8d3f7 (diff)
runtime: QA for lock()/unlock() deadlock
Diffstat (limited to 'gr-blocks/python')
-rwxr-xr-xgr-blocks/python/blocks/qa_hier_block2.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/gr-blocks/python/blocks/qa_hier_block2.py b/gr-blocks/python/blocks/qa_hier_block2.py
index 5a351f2b37..97206a248d 100755
--- a/gr-blocks/python/blocks/qa_hier_block2.py
+++ b/gr-blocks/python/blocks/qa_hier_block2.py
@@ -2,6 +2,7 @@
from gnuradio import gr, gr_unittest, blocks
import numpy
+import time
class add_ff(gr.sync_block):
def __init__(self):
@@ -426,5 +427,20 @@ class test_hier_block2(gr_unittest.TestCase):
procs = hblock.processor_affinity()
self.assertEquals((0,), procs)
+ def test_lock_unlock(self):
+ hblock = gr.top_block("test_block")
+ src = blocks.null_source(gr.sizeof_float)
+ throttle = blocks.throttle(gr.sizeof_float, 32000)
+ hier = multiply_const_ff(0.5)
+ sink = blocks.null_sink(gr.sizeof_float)
+ hblock.connect(src, throttle, hier, sink)
+ hblock.set_processor_affinity([0,])
+ hblock.start()
+ time.sleep(1)
+ hblock.lock()
+ hblock.unlock()
+ hblock.stop()
+ hblock.wait()
+
if __name__ == "__main__":
gr_unittest.run(test_hier_block2, "test_hier_block2.xml")