summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/message_strobe_impl.h
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-03-13 14:34:50 -0400
committerTom Rondeau <tom@trondeau.com>2015-03-13 14:34:50 -0400
commit1c33a22e92654bb8333fcd0360414a514e6927f8 (patch)
tree352d1dfe9a726fb453144524dd1621f1a36d471c /gr-blocks/lib/message_strobe_impl.h
parent13cf0ce205bfc986e462591764cb7ca16e21346c (diff)
blocks: message strobe shutdown fix.
On embedded systems, this block's destructure was not getting called in the right order and the flowgraph would hang because this block's thread running run would never quit. Moving the start and stop handling of this thread to the start/stop functions of the block fix this. Also makes sure that the block is only producing messages when the flowgraph is running.
Diffstat (limited to 'gr-blocks/lib/message_strobe_impl.h')
-rw-r--r--gr-blocks/lib/message_strobe_impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gr-blocks/lib/message_strobe_impl.h b/gr-blocks/lib/message_strobe_impl.h
index 0f37cd2e0e..3ce71af58f 100644
--- a/gr-blocks/lib/message_strobe_impl.h
+++ b/gr-blocks/lib/message_strobe_impl.h
@@ -46,6 +46,11 @@ namespace gr {
pmt::pmt_t msg() const { return d_msg; }
void set_period(float period_ms) { d_period_ms = period_ms; }
float period() const { return d_period_ms; }
+
+ // Overloading these to start and stop the internal thread that
+ // periodically produces the message.
+ bool start();
+ bool stop();
};
} /* namespace blocks */