diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-12 23:55:18 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-06-12 23:55:18 +0400 |
commit | 1b3cba8e60c67c968d108ac55c77e32c1928dec3 (patch) | |
tree | 79ce35debeb7e203558d884efd03c7cf160cceaa /include | |
parent | 14a73f54798f39854e521fb596da7d50b7566bbd (diff) | |
parent | 7a232e0350940d2664f4de5cc3f0f443bae5062d (diff) | |
download | linux-1b3cba8e60c67c968d108ac55c77e32c1928dec3.tar.xz |
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: 64-bit: fix arithmetics overflow
sched: fair group: fix overflow(was: fix divide by zero)
sched: fix TASK_WAKEKILL vs SIGKILL race
Diffstat (limited to 'include')
-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 ae0be3c62375..c5d3f847ca8d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2026,6 +2026,19 @@ static inline int fatal_signal_pending(struct task_struct *p) return signal_pending(p) && __fatal_signal_pending(p); } +static inline int signal_pending_state(long state, struct task_struct *p) +{ + if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL))) + return 0; + if (!signal_pending(p)) + return 0; + + if (state & (__TASK_STOPPED | __TASK_TRACED)) + return 0; + + return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p); +} + static inline int need_resched(void) { return unlikely(test_thread_flag(TIF_NEED_RESCHED)); |