diff options
author | Josh Blum | 2012-09-07 20:46:31 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-07 20:46:31 -0700 |
commit | d80ca1ce3e89db619d0b65b8b8c44fe8d3ba6a93 (patch) | |
tree | a5ddf6926820b71ee212712112491f98a334fe87 /lib/block_handlers.cpp | |
parent | be3195c9a61ff726c2f13a6ae9e33d586bebce3b (diff) | |
download | sandhi-d80ca1ce3e89db619d0b65b8b8c44fe8d3ba6a93.tar.gz sandhi-d80ca1ce3e89db619d0b65b8b8c44fe8d3ba6a93.tar.bz2 sandhi-d80ca1ce3e89db619d0b65b8b8c44fe8d3ba6a93.zip |
call start/stop hooks on block state change
Diffstat (limited to 'lib/block_handlers.cpp')
-rw-r--r-- | lib/block_handlers.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp index b62df4e..c9d97bb 100644 --- a/lib/block_handlers.cpp +++ b/lib/block_handlers.cpp @@ -87,6 +87,10 @@ void ElementImpl::handle_block_msg( if (msg.cast<TopBlockMessage>().what == TopBlockMessage::ACTIVE) { + if (this->block_state != BLOCK_STATE_LIVE) + { + this->block_ptr->start(); + } this->block_state = BLOCK_STATE_LIVE; if (this->input_queues.all_ready() and this->output_queues.all_ready()) { @@ -96,6 +100,10 @@ void ElementImpl::handle_block_msg( if (msg.cast<TopBlockMessage>().what == TopBlockMessage::INERT) { + if (this->block_state != BLOCK_STATE_DONE) + { + this->block_ptr->stop(); + } this->mark_done(task_iface); } } |