summaryrefslogtreecommitdiff
path: root/lib/input_handlers.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-03-18 20:38:03 -0700
committerJosh Blum2013-03-18 20:38:03 -0700
commit71a5eed84e050e111ff60006312936f93efdae91 (patch)
tree5e658042c7b7a4b5c5480f25b118e2c7ec5b6a99 /lib/input_handlers.cpp
parent84effc390649937ab2f79bbfdf56a00dba38569e (diff)
downloadsandhi-71a5eed84e050e111ff60006312936f93efdae91.tar.gz
sandhi-71a5eed84e050e111ff60006312936f93efdae91.tar.bz2
sandhi-71a5eed84e050e111ff60006312936f93efdae91.zip
gras: msg port reserve tweak convenience
Diffstat (limited to 'lib/input_handlers.cpp')
-rw-r--r--lib/input_handlers.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index c15885d..e3b5203 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -22,7 +22,19 @@ void BlockActor::handle_input_msg(const InputMsgMessage &message, const Theron::
MESSAGE_TRACER();
const size_t index = message.index;
+ //got an input message? remove the item reserve
+ //This is for user convenience so msg ports
+ //dont need any special configuration to work.
+ if (this->input_configs[index].reserve_items)
+ {
+ this->input_configs[index].reserve_items = 0;
+ InputUpdateMessage message;
+ message.index = index;
+ this->handle_input_update(message, Theron::Address());
+ }
+
//handle incoming async message, push into the msg storage
+ if (this->block_state == BLOCK_STATE_DONE) return;
this->input_msgs[index].push_back(message.msg);
this->inputs_available.set(index);