提交 27d91e07 编写于 作者: R Roland McGrath 提交者: Linus Torvalds

[PATCH] __dequeue_signal() cleanup

This tightens up __dequeue_signal a little.  It also avoids doing
recalc_sigpending twice in a row, instead doing it once in dequeue_signal.
Signed-off-by: NRoland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b9ecb2bd
...@@ -417,9 +417,8 @@ static int collect_signal(int sig, struct sigpending *list, siginfo_t *info) ...@@ -417,9 +417,8 @@ static int collect_signal(int sig, struct sigpending *list, siginfo_t *info)
static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, static int __dequeue_signal(struct sigpending *pending, sigset_t *mask,
siginfo_t *info) siginfo_t *info)
{ {
int sig = 0; int sig = next_signal(pending, mask);
sig = next_signal(pending, mask);
if (sig) { if (sig) {
if (current->notifier) { if (current->notifier) {
if (sigismember(current->notifier_mask, sig)) { if (sigismember(current->notifier_mask, sig)) {
...@@ -432,9 +431,7 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, ...@@ -432,9 +431,7 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask,
if (!collect_signal(sig, pending, info)) if (!collect_signal(sig, pending, info))
sig = 0; sig = 0;
} }
recalc_sigpending();
return sig; return sig;
} }
...@@ -451,6 +448,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info) ...@@ -451,6 +448,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
if (!signr) if (!signr)
signr = __dequeue_signal(&tsk->signal->shared_pending, signr = __dequeue_signal(&tsk->signal->shared_pending,
mask, info); mask, info);
recalc_sigpending_tsk(tsk);
if (signr && unlikely(sig_kernel_stop(signr))) { if (signr && unlikely(sig_kernel_stop(signr))) {
/* /*
* Set a marker that we have dequeued a stop signal. Our * Set a marker that we have dequeued a stop signal. Our
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册