From 3868a90728478e541d7b1b4864da1fbef59bcf34 Mon Sep 17 00:00:00 2001 From: Tim O'Shea Date: Wed, 8 May 2013 23:25:28 +0100 Subject: runtime: fix for thread safety issue during simultaneous use of stream tags and performance counters --- gnuradio-core/src/lib/runtime/gr_block_detail.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/runtime/gr_block_detail.cc b/gnuradio-core/src/lib/runtime/gr_block_detail.cc index af80e61cf..ecc0c1f98 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_detail.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_detail.cc @@ -261,6 +261,7 @@ gr_block_detail::stop_perf_counters(int noutput_items, int nproduced) d_var_input_buffers_full[i] = 0; } for(size_t i=0; i < d_output.size(); i++) { + gr::thread::scoped_lock guard(*d_output[i]->mutex()); float pfull = 1.0f - static_cast(d_output[i]->space_available()) / static_cast(d_output[i]->bufsize()); d_avg_output_buffers_full[i] = pfull; @@ -290,6 +291,7 @@ gr_block_detail::stop_perf_counters(int noutput_items, int nproduced) } for(size_t i=0; i < d_output.size(); i++) { + gr::thread::scoped_lock guard(*d_output[i]->mutex()); float pfull = 1.0f - static_cast(d_output[i]->space_available()) / static_cast(d_output[i]->bufsize()); -- cgit