diff options
author | rear1019 <rear1019@posteo.de> | 2017-11-19 20:47:10 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-03 14:16:46 +0100 |
commit | 7c4f0d6ab4886504f4fc879cbb2de5c4bad4a35c (patch) | |
tree | 896e3fc0caf675699cbe5cc59916b925c188e62e | |
parent | 8d0d97a394114db527b0bf7995824804a01408d5 (diff) |
docs: Add missing information on usage of produce()/consume()
-rw-r--r-- | gnuradio-runtime/include/gnuradio/block.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gnuradio-runtime/include/gnuradio/block.h b/gnuradio-runtime/include/gnuradio/block.h index 3e74dd8c93..acb99c42d9 100644 --- a/gnuradio-runtime/include/gnuradio/block.h +++ b/gnuradio-runtime/include/gnuradio/block.h @@ -228,13 +228,19 @@ namespace gr { /*! * \brief Tell the scheduler \p how_many_items of input stream \p * which_input were consumed. - * This function should be called at the end of work() or general_work(), after all processing is finished. + * + * This function should be used in general_work() to tell the scheduler the + * number of input items processed. Calling consume() multiple times in the + * same general_work() call is safe. Every invocation of consume() updates + * the values returned by nitems_read(). */ void consume(int which_input, int how_many_items); /*! * \brief Tell the scheduler \p how_many_items were consumed on * each input stream. + * + * Also see notes on consume(). */ void consume_each(int how_many_items); @@ -242,8 +248,12 @@ namespace gr { * \brief Tell the scheduler \p how_many_items were produced on * output stream \p which_output. * - * If the block's general_work method calls produce, \p - * general_work must return WORK_CALLED_PRODUCE. + * This function should be used in general_work() to tell the scheduler the + * number of output items produced. If produce() is called in + * general_work(), general_work() must return \p WORK_CALLED_PRODUCE. + * Calling produce() multiple times in the same general_work() call is safe. + * Every invocation of produce() updates the values returned by + * nitems_written(). */ void produce(int which_output, int how_many_items); |