summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/runtime/gr_buffer.cc
diff options
context:
space:
mode:
authorTom Rondeau2010-11-08 19:52:50 -0500
committerTom Rondeau2010-11-08 19:52:50 -0500
commitab8c921bf73b61c19305bc0bf1fc4d26b110779e (patch)
tree7db1191c966c5cf75f4d3c77763bef99b2fd952d /gnuradio-core/src/lib/runtime/gr_buffer.cc
parent4cb301dec845778e468c73dac5eb04a9dfccb14a (diff)
downloadgnuradio-ab8c921bf73b61c19305bc0bf1fc4d26b110779e.tar.gz
gnuradio-ab8c921bf73b61c19305bc0bf1fc4d26b110779e.tar.bz2
gnuradio-ab8c921bf73b61c19305bc0bf1fc4d26b110779e.zip
Adding mutex protection around adding and getting tags from buffers.
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_buffer.cc')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc
index 862d92b81..1d67470ec 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.cc
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc
@@ -219,6 +219,7 @@ gr_buffer::drop_reader (gr_buffer_reader *reader)
void
gr_buffer::add_item_tag(const pmt::pmt_t &tag)
{
+ gruel::scoped_lock guard(*mutex());
d_item_tags.push_back(tag);
}
@@ -267,6 +268,8 @@ std::vector<pmt::pmt_t>
gr_buffer_reader::get_tags_in_range(uint64_t abs_start,
uint64_t abs_end)
{
+ gruel::scoped_lock guard(*mutex());
+
std::vector<pmt::pmt_t> found_items;
std::deque<pmt::pmt_t>::iterator itr = d_buffer->get_tags_begin();