diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:15:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:15:21 -0400 |
commit | f9e8e07e074a880e110922759dcdb369fecdf07c (patch) | |
tree | 61bc9a61e0a0546a81d699047d9e001c50b52d50 /include/linux/sched.h | |
parent | e9886ca3a93d7d041d3de8e5acebe213da777d59 (diff) | |
parent | 066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff) |
Merge branch 'linus' into sched-devel
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)); |