include/linux/sched.h
/*
* Task state bitmask. NOTE! These bits are also
* encoded in fs/proc/array.c: get_task_state().
*
* We have two separate sets of flags: task->state
* is about runnability, while task->exit_state are
* about the task exiting. Confusing, but this way
* modifying one set can't modify the other one by
* mistake.
*/
由此可见线程的状态是由state和exit_state组合起来表示的。
exit_state只包含EXIT_ZOMBIE和EXIT_DEAD状态。
/*
* Task state bitmask. NOTE! These bits are also
* encoded in fs/proc/array.c: get_task_state().
*
* We have two separate sets of flags: task->state
* is about runnability, while task->exit_state are
* about the task exiting. Confusing, but this way
* modifying one set can't modify the other one by
* mistake.
*/
由此可见线程的状态是由state和exit_state组合起来表示的。
exit_state只包含EXIT_ZOMBIE和EXIT_DEAD状态。
in fs/proc/array.c: get_task_state()
unsigned int state = (tsk->state & TASK_REPORT) | tsk->exit_state;