+/**
+ * The possible states of a task.
+ *
+ * In addition to the states listed here, a task may also enter zombie state.
+ * This happens when its ->post_select function returns negative, the ->status
+ * field is then set to this return value. Such tasks are not scheduled any
+ * more (i.e. ->pre_select() and ->post_select() are no longer called), but
+ * they stay on the scheduler task list until \ref task_reap() or
+ * \ref sched_shutdown() is called.
+ */
+enum task_status {
+ /** Task has been reaped and may be removed from the task list. */
+ TS_DEAD,
+ /** Task is active. */
+ TS_RUNNING,
+};
+
+struct task {
+ /** A copy of the task name supplied when the task was registered. */
+ char *name;
+ /** Copied during task_register(). */
+ struct task_info info;
+ /* TS_RUNNING, TS_DEAD, or zombie (negative value). */
+ int status;
+ /** Position of the task in the task list of the scheduler. */
+ struct list_head node;
+ /** If less than zero, the task was notified by another task. */
+ int notification;
+};