summaryrefslogtreecommitdiff
path: root/lib/block_task.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-11-07 01:16:49 -0800
committerJosh Blum2012-11-07 01:16:49 -0800
commit4e6548ed237f3d6eda4383d6a07a4d1e99f404f6 (patch)
tree6b10f8d47259eb831eec88c07f95b7bfbc6b3fb4 /lib/block_task.cpp
parent0f0c68c4a8c32c43eee8f1589878abe376e2b1da (diff)
downloadsandhi-4e6548ed237f3d6eda4383d6a07a4d1e99f404f6.tar.gz
sandhi-4e6548ed237f3d6eda4383d6a07a4d1e99f404f6.tar.bz2
sandhi-4e6548ed237f3d6eda4383d6a07a4d1e99f404f6.zip
some fixes from the last commit
Diffstat (limited to 'lib/block_task.cpp')
-rw-r--r--lib/block_task.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index cfe5bb0..ee4d075 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -75,13 +75,6 @@ void BlockActor::input_fail(const size_t i)
{
SBuffer &buff = this->input_queues.front(i);
- //check that the input is not already maxed
- const size_t front_items = buff.length/this->input_items_sizes[i];
- if (front_items >= this->input_configs[i].maximum_items)
- {
- //throw std::runtime_error("input_fail called on maximum_items buffer");
- }
-
//input failed, accumulate and try again
if (not this->input_queues.is_accumulated(i))
{
@@ -91,7 +84,18 @@ void BlockActor::input_fail(const size_t i)
}
//otherwise check for done, else wait for more
- if (this->inputs_done[i]) this->mark_done();
+ if (this->inputs_done[i])
+ {
+ this->mark_done();
+ return;
+ }
+
+ //check that the input is not already maxed
+ const size_t front_items = buff.length/this->input_items_sizes[i];
+ if (front_items >= this->input_configs[i].maximum_items)
+ {
+ //throw std::runtime_error("input_fail called on maximum_items buffer");
+ }
}
void BlockActor::output_fail(const size_t i)