diff options
author | Louis Philippe Lessard <git@louif.com> | 2013-10-04 18:37:35 -0400 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-10-05 10:10:22 -0400 |
commit | 03ed4becd5b90d482b68cad397ce6b6d3e59712e (patch) | |
tree | 94ab983dbee97407e7f347156210c569ac80a7d2 | |
parent | e58336c6f427c58ba114b627e586a85863b10103 (diff) |
fix: max_noutput_items is set globally but it should be local to a block.
-rw-r--r-- | gnuradio-runtime/lib/scheduler_tpb.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gnuradio-runtime/lib/scheduler_tpb.cc b/gnuradio-runtime/lib/scheduler_tpb.cc index d35c37fb34..2fe9e10f6a 100644 --- a/gnuradio-runtime/lib/scheduler_tpb.cc +++ b/gnuradio-runtime/lib/scheduler_tpb.cc @@ -55,6 +55,8 @@ namespace gr { int max_noutput_items) : scheduler(ffg, max_noutput_items) { + int block_max_noutput_items; + // Get a topologically sorted vector of all the blocks in use. // Being topologically sorted probably isn't going to matter, but // there's a non-zero chance it might help... @@ -76,12 +78,16 @@ namespace gr { name << "thread-per-block[" << i << "]: " << blocks[i]; // If set, use internal value instead of global value - if(blocks[i]->is_set_max_noutput_items()) - max_noutput_items = blocks[i]->max_noutput_items(); + if(blocks[i]->is_set_max_noutput_items()) { + block_max_noutput_items = blocks[i]->max_noutput_items(); + } + else { + block_max_noutput_items = max_noutput_items; + } d_threads.create_thread( gr::thread::thread_body_wrapper<tpb_container> - (tpb_container(blocks[i], max_noutput_items), + (tpb_container(blocks[i], block_max_noutput_items), name.str())); } } |