sched: Introduce task_is_running()
Replace a bunch of 'p->state == TASK_RUNNING' with a new helper: task_is_running(p). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Davidlohr Bueso <dave@stgolabs.net> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20210611082838.222401495@infradead.org
This commit is contained in:
@@ -113,6 +113,8 @@ struct task_group;
|
||||
__TASK_TRACED | EXIT_DEAD | EXIT_ZOMBIE | \
|
||||
TASK_PARKED)
|
||||
|
||||
#define task_is_running(task) (READ_ONCE((task)->state) == TASK_RUNNING)
|
||||
|
||||
#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
|
||||
|
||||
#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
|
||||
|
||||
Reference in New Issue
Block a user