summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ufo/ufo-scheduler.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/ufo/ufo-scheduler.c b/ufo/ufo-scheduler.c
index 8d86524..317724c 100644
--- a/ufo/ufo-scheduler.c
+++ b/ufo/ufo-scheduler.c
@@ -279,13 +279,30 @@ run_task (TaskLocalData *tld)
case UFO_TASK_MODE_REDUCTOR:
do {
- ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_BEGIN);
- ufo_task_process (tld->task, inputs, output, &requisition);
- ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_END);
-
- release_inputs (tld, inputs);
- active = get_inputs (tld, inputs);
+ gboolean go_on = TRUE;
+
+ do {
+ ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_BEGIN);
+ go_on = ufo_task_process (tld->task, inputs, output, &requisition);
+ ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_PROCESS | UFO_TRACE_EVENT_END);
+
+ release_inputs (tld, inputs);
+ active = get_inputs (tld, inputs);
+ go_on = go_on && active;
+ } while (go_on);
+
+ do {
+ ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_GENERATE | UFO_TRACE_EVENT_BEGIN);
+ go_on = ufo_task_generate (tld->task, output, &requisition);
+ ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_GENERATE | UFO_TRACE_EVENT_END);
+
+ if (go_on) {
+ ufo_group_push_output_buffer (group, output);
+ output = ufo_group_pop_output_buffer (group, &requisition);
+ }
+ } while (go_on);
} while (active);
+
break;
case UFO_TASK_MODE_GENERATOR:
@@ -305,19 +322,6 @@ run_task (TaskLocalData *tld)
if (active)
release_inputs (tld, inputs);
- if (mode == UFO_TASK_MODE_REDUCTOR) {
- do {
- ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_GENERATE | UFO_TRACE_EVENT_BEGIN);
- active = ufo_task_generate (tld->task, output, &requisition);
- ufo_profiler_trace_event (profiler, UFO_TRACE_EVENT_GENERATE | UFO_TRACE_EVENT_END);
-
- if (active) {
- ufo_group_push_output_buffer (group, output);
- output = ufo_group_pop_output_buffer (group, &requisition);
- }
- } while (active);
- }
-
if (!active)
ufo_group_finish (group);
}