summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorTim O'Shea2013-05-08 23:25:28 +0100
committerTom Rondeau2013-05-08 19:16:01 -0400
commit3868a90728478e541d7b1b4864da1fbef59bcf34 (patch)
treebd67ff42e76ed5c92cf493e908f40d9bef7caaa1 /gnuradio-core/src/lib
parentbad3b840f0408d18082de5fca8ae5804a751a30d (diff)
downloadgnuradio-3868a90728478e541d7b1b4864da1fbef59bcf34.tar.gz
gnuradio-3868a90728478e541d7b1b4864da1fbef59bcf34.tar.bz2
gnuradio-3868a90728478e541d7b1b4864da1fbef59bcf34.zip
runtime: fix for thread safety issue during simultaneous use of stream tags and performance counters
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_detail.cc2
1 files changed, 2 insertions, 0 deletions
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<float>(d_output[i]->space_available()) /
static_cast<float>(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<float>(d_output[i]->space_available()) /
static_cast<float>(d_output[i]->bufsize());