diff options
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 2db1485f865d..eaf821072dbd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2009,6 +2009,19 @@ static inline int fatal_signal_pending(struct task_struct *p) | |||
2009 | return signal_pending(p) && __fatal_signal_pending(p); | 2009 | return signal_pending(p) && __fatal_signal_pending(p); |
2010 | } | 2010 | } |
2011 | 2011 | ||
2012 | static inline int signal_pending_state(long state, struct task_struct *p) | ||
2013 | { | ||
2014 | if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL))) | ||
2015 | return 0; | ||
2016 | if (!signal_pending(p)) | ||
2017 | return 0; | ||
2018 | |||
2019 | if (state & (__TASK_STOPPED | __TASK_TRACED)) | ||
2020 | return 0; | ||
2021 | |||
2022 | return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); | ||
2023 | } | ||
2024 | |||
2012 | static inline int need_resched(void) | 2025 | static inline int need_resched(void) |
2013 | { | 2026 | { |
2014 | return unlikely(test_thread_flag(TIF_NEED_RESCHED)); | 2027 | return unlikely(test_thread_flag(TIF_NEED_RESCHED)); |