Commit f776d12d authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Matthew Wilcox

Add fatal_signal_pending

Like signal_pending, but it's only true for signals which are fatal to
this process
Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
parent f021a3c2
...@@ -1872,7 +1872,14 @@ static inline int signal_pending(struct task_struct *p) ...@@ -1872,7 +1872,14 @@ static inline int signal_pending(struct task_struct *p)
{ {
return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING));
} }
extern int FASTCALL(__fatal_signal_pending(struct task_struct *p));
static inline int fatal_signal_pending(struct task_struct *p)
{
return signal_pending(p) && __fatal_signal_pending(p);
}
static inline int need_resched(void) static inline int need_resched(void)
{ {
return unlikely(test_thread_flag(TIF_NEED_RESCHED)); return unlikely(test_thread_flag(TIF_NEED_RESCHED));
......
...@@ -994,6 +994,11 @@ void zap_other_threads(struct task_struct *p) ...@@ -994,6 +994,11 @@ void zap_other_threads(struct task_struct *p)
} }
} }
int fastcall __fatal_signal_pending(struct task_struct *tsk)
{
return sigismember(&tsk->pending.signal, SIGKILL);
}
/* /*
* Must be called under rcu_read_lock() or with tasklist_lock read-held. * Must be called under rcu_read_lock() or with tasklist_lock read-held.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment