Commit fbde70f0 by Marcus Winter

mtapi_c: fixed task handling

parent 3fb52e5d
...@@ -230,8 +230,8 @@ void embb_mtapi_scheduler_finalize_task( ...@@ -230,8 +230,8 @@ void embb_mtapi_scheduler_finalize_task(
if (MTAPI_NULL != task->attributes.complete_func) { if (MTAPI_NULL != task->attributes.complete_func) {
task->attributes.complete_func(task->handle, MTAPI_NULL); task->attributes.complete_func(task->handle, MTAPI_NULL);
} }
/* delete task if detached */ /* delete task if detached and not in a group */
if (MTAPI_TRUE == task->attributes.is_detached) { if (MTAPI_NULL == group && MTAPI_TRUE == task->attributes.is_detached) {
embb_mtapi_task_delete(task, node->task_pool); embb_mtapi_task_delete(task, node->task_pool);
} }
} }
......
...@@ -146,7 +146,7 @@ mtapi_boolean_t embb_mtapi_task_queue_process( ...@@ -146,7 +146,7 @@ mtapi_boolean_t embb_mtapi_task_queue_process(
if (embb_spin_lock(&that->lock) == EMBB_SUCCESS) { if (embb_spin_lock(&that->lock) == EMBB_SUCCESS) {
idx = that->get_task_position; idx = that->get_task_position;
for (ii = 0; ii < that->tasks_available; ii++) { for (ii = 0; ii < that->tasks_available; ii++) {
result = process(that->task_buffer[ii], user_data); result = process(that->task_buffer[idx], user_data);
if (MTAPI_FALSE == result) { if (MTAPI_FALSE == result) {
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment