{
PARA_INFO_LOG("freeing task %s\n", t->status);
list_del(&t->node);
- if (t->owned_by_sched)
- free(t);
+ free(t);
}
//#define SCHED_DEBUG 1
}
call_post_select(s, t);
t->notification = 0;
- if (t->error < 0) {
- if (!t->owned_by_sched)
- list_del(&t->node);
- } else
+ if (t->error >= 0)
num_running_tasks++;
}
return num_running_tasks;
t = *tptr;
if (!t)
return 0;
- if (!t->owned_by_sched)
- return 0;
if (t->error >= 0)
return 0;
if (t->dead) /* will be freed in sched_post_select() */
t->pre_select = info->pre_select;
t->post_select = info->post_select;
t->context = info->context;
- t->owned_by_sched = true;
list_add_tail(&t->node, &s->task_list);
return t;
}
*/
void *task_context(struct task *t)
{
- assert(t->owned_by_sched);
return t->context;
}
char status[255];
/** If less than zero, the task was notified by another task. */
int notification;
- /** Whether the task structure should be freed in sched_shutdown(). */
- bool owned_by_sched;
/** True if task is in error state and exit status has been queried. */
bool dead;
/** Usually a pointer to the struct containing this task. */