X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=sched.h;h=05b6c51e725b31bba2f75bf46d1faf714e5ebe2e;hb=721ab0e5ab4b6533e0464e61ad655596f9f6904c;hp=fd714b618b681720b4ee187401f57d39fbd001f7;hpb=8bf35b38357c3ce59f52ae87f6e84e4b6d183ac7;p=paraslash.git diff --git a/sched.h b/sched.h index fd714b61..05b6c51e 100644 --- a/sched.h +++ b/sched.h @@ -33,33 +33,7 @@ struct sched { struct list_head task_list; }; -/** - * Paraslash's task structure. - * - * This is considered an internal structure and will eventually be made private. - * - * \sa \ref sched. - */ -struct task { - /** Copied from the task_info struct during task_register(). */ - void (*pre_select)(struct sched *s, struct task *t); - /** Copied from the task_info struct during task_register(). */ - int (*post_select)(struct sched *s, struct task *t); - /** Whether this task is active (>=0) or in error state (<0). */ - int error; - /** Position of the task in the task list of the scheduler. */ - struct list_head node; - /** The task name supplied when the task was registered(). */ - 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. */ - void *context; -}; +struct task; /** Information that must be supplied by callers of \ref task_register(). */ struct task_info { @@ -99,13 +73,13 @@ extern struct timeval *now; struct task *task_register(struct task_info *info, struct sched *s); void *task_context(struct task *t); -void register_task(struct sched *s, struct task *t); int schedule(struct sched *s); void sched_shutdown(struct sched *s); char *get_task_list(struct sched *s); void task_notify(struct task *t, int err); void task_notify_all(struct sched *s, int err); int task_get_notification(const struct task *t); +int task_status(const struct task *t); int task_reap(struct task **tptr); void sched_min_delay(struct sched *s); void sched_request_timeout(struct timeval *to, struct sched *s);