summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau2010-11-21 14:33:58 -0500
committerTom Rondeau2010-11-21 14:33:58 -0500
commitb34360471571ea7346ab1c6cb87700a920ca5798 (patch)
tree77fa6b8d05cb1f2e3ebcefb08cf91b8f53e526fd /gnuradio-core
parent8176675bcd887d760cc2413f9326d5515641d800 (diff)
downloadgnuradio-b34360471571ea7346ab1c6cb87700a920ca5798.tar.gz
gnuradio-b34360471571ea7346ab1c6cb87700a920ca5798.tar.bz2
gnuradio-b34360471571ea7346ab1c6cb87700a920ca5798.zip
Fixing flowgraph dump to clean it up (via patch from eb). Also added note about mutex locking in prune_tags.
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_buffer.cc8
-rw-r--r--gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc7
2 files changed, 10 insertions, 5 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc
index 1488e92f6..0b2eb52a0 100644
--- a/gnuradio-core/src/lib/runtime/gr_buffer.cc
+++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc
@@ -231,6 +231,14 @@ gr_buffer::add_item_tag(const pmt::pmt_t &tag)
void
gr_buffer::prune_tags(uint64_t max_time)
{
+ /* NOTE: this function _should_ lock the mutex before editing
+ d_item_tags. In practice, this function is only called at
+ runtime by min_available_space in gr_block_executor.cc,
+ which locks the mutex itself.
+
+ If this function is used elsewhere, remember to lock the
+ buffer's mutex al la the scoped_lock line below.
+ */
//gruel::scoped_lock guard(*mutex());
int n = 0;
diff --git a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
index 031eb6dfd..5d1057e0f 100644
--- a/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
+++ b/gnuradio-core/src/lib/runtime/gr_flat_flowgraph.cc
@@ -264,16 +264,13 @@ void gr_flat_flowgraph::dump()
int no = detail->noutputs();
for (int i = 0; i < no; i++) {
gr_buffer_sptr buffer = detail->output(i);
- std::cout << " output " << i << ": " << buffer
- << " space=" << buffer->space_available() << std::endl;
+ std::cout << " output " << i << ": " << buffer << std::endl;
}
for (int i = 0; i < ni; i++) {
gr_buffer_reader_sptr reader = detail->input(i);
std::cout << " reader " << i << ": " << reader
- << " reading from buffer=" << reader->buffer()
- << " avail=" << reader->items_available() << " items"
- << std::endl;
+ << " reading from buffer=" << reader->buffer() << std::endl;
}
}