summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-06-12 12:55:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-06-12 12:55:18 -0700
commit1b3cba8e60c67c968d108ac55c77e32c1928dec3 (patch)
tree79ce35debeb7e203558d884efd03c7cf160cceaa /include/linux
parent14a73f54798f39854e521fb596da7d50b7566bbd (diff)
parent7a232e0350940d2664f4de5cc3f0f443bae5062d (diff)
downloadop-kernel-dev-1b3cba8e60c67c968d108ac55c77e32c1928dec3.zip
op-kernel-dev-1b3cba8e60c67c968d108ac55c77e32c1928dec3.tar.gz
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/linux')
-rw-r--r--include/linux/sched.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ae0be3c..c5d3f84 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));
OpenPOWER on IntegriCloud