- int (*post_select)(struct sched *s, struct task *t);
- /** Whether this task is in error state. */
- int error;
- /** Position of the task in the pre_select list of the scheduler. */
- struct list_head pre_select_node;
- /** Position of the task in the post_select list of the scheduler. */
- struct list_head post_select_node;
- /** Descriptive text and current status of the task. */
- char status[255];
- /** If less than zero, the task was notified by another task. */
- int notification;
+ int (*post_select)(struct sched *s, void *context);
+ /**
+ * This pointer is saved when the task is registered. It is passed to
+ * ->pre_select() and ->post_select(). Usually this is a pointer to the
+ * struct owned by the caller which contains the task pointer.
+ */
+ void *context;