summaryrefslogtreecommitdiff
path: root/lib/block_task.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-03 03:31:09 -0700
committerJosh Blum2012-09-03 03:31:09 -0700
commitb9d92f31d7eee9bf1707fa622b6bea531e41c693 (patch)
tree46d451601451efba94aee4bc77c4bf30b6ff613b /lib/block_task.cpp
parent8801221bb8feec2e68680e1bd74ceded69307ab2 (diff)
downloadsandhi-b9d92f31d7eee9bf1707fa622b6bea531e41c693.tar.gz
sandhi-b9d92f31d7eee9bf1707fa622b6bea531e41c693.tar.bz2
sandhi-b9d92f31d7eee9bf1707fa622b6bea531e41c693.zip
added output buff flush for mark done
Diffstat (limited to 'lib/block_task.cpp')
-rw-r--r--lib/block_task.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index e436bc1..6954382 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -24,6 +24,18 @@ void ElementImpl::mark_done(const tsbe::TaskInterface &task_iface)
{
if (this->block_state == BLOCK_STATE_DONE) return; //can re-enter checking done first
+ //flush partial output buffers to the downstream
+ for (size_t i = 0; i < task_iface.get_num_outputs(); i++)
+ {
+ if (this->output_bytes_offset[i] == 0) continue;
+ ASSERT(this->output_queues.ready(i));
+ tsbe::Buffer &buff = this->output_queues.front(i);
+ buff.get_length() = this->output_bytes_offset[i];
+ task_iface.post_downstream(i, buff);
+ this->output_queues.pop(i);
+ this->output_bytes_offset[i] = 0;
+ }
+
//mark down the new state
this->block_state = BLOCK_STATE_DONE;