patch-2.4.10 linux/kernel/signal.c

Next file: linux/kernel/softirq.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/kernel/signal.c linux/kernel/signal.c
@@ -242,16 +242,16 @@
 #endif
 
 	sig = next_signal(current, mask);
-	if (current->notifier) {
-		if (sigismember(current->notifier_mask, sig)) {
-			if (!(current->notifier)(current->notifier_data)) {
-				current->sigpending = 0;
-				return 0;
+	if (sig) {
+		if (current->notifier) {
+			if (sigismember(current->notifier_mask, sig)) {
+				if (!(current->notifier)(current->notifier_data)) {
+					current->sigpending = 0;
+					return 0;
+				}
 			}
 		}
-	}
 
-	if (sig) {
 		if (!collect_signal(sig, &current->pending, info))
 			sig = 0;
 				
@@ -467,11 +467,6 @@
 {
 	t->sigpending = 1;
 
-	if (t->state & TASK_INTERRUPTIBLE) {
-		wake_up_process(t);
-		return;
-	}
-
 #ifdef CONFIG_SMP
 	/*
 	 * If the task is running on a different CPU 
@@ -488,6 +483,11 @@
 		smp_send_reschedule(t->processor);
 	spin_unlock(&runqueue_lock);
 #endif /* CONFIG_SMP */
+
+	if (t->state & TASK_INTERRUPTIBLE) {
+		wake_up_process(t);
+		return;
+	}
 }
 
 static int deliver_signal(int sig, struct siginfo *info, struct task_struct *t)
@@ -544,8 +544,6 @@
 	ret = deliver_signal(sig, info, t);
 out:
 	spin_unlock_irqrestore(&t->sigmask_lock, flags);
-	if ((t->state & TASK_INTERRUPTIBLE) && signal_pending(t))
-		wake_up_process(t);
 out_nolock:
 #if DEBUG_SIG
 printk(" %d -> %d\n", signal_pending(t), ret);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)