introduce for_other_threads(p, t)
[linux-2.6-block.git] / kernel / signal.c
index 47a7602dfe8df43e786b7b33119b71599372b151..5aa216e841a292dbb570b219f01869765d6d13f5 100644 (file)
@@ -1376,12 +1376,12 @@ int force_sig_info(struct kernel_siginfo *info)
  */
 int zap_other_threads(struct task_struct *p)
 {
-       struct task_struct *t = p;
+       struct task_struct *t;
        int count = 0;
 
        p->signal->group_stop_count = 0;
 
-       while_each_thread(p, t) {
+       for_other_threads(p, t) {
                task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK);
                /* Don't require de_thread to wait for the vhost_worker */
                if ((t->flags & (PF_IO_WORKER | PF_USER_WORKER)) != PF_USER_WORKER)
@@ -2465,12 +2465,10 @@ static bool do_signal_stop(int signr)
                        sig->group_exit_code = signr;
 
                sig->group_stop_count = 0;
-
                if (task_set_jobctl_pending(current, signr | gstop))
                        sig->group_stop_count++;
 
-               t = current;
-               while_each_thread(current, t) {
+               for_other_threads(current, t) {
                        /*
                         * Setting state to TASK_STOPPED for a group
                         * stop is always done with the siglock held,
@@ -2966,8 +2964,7 @@ static void retarget_shared_pending(struct task_struct *tsk, sigset_t *which)
        if (sigisemptyset(&retarget))
                return;
 
-       t = tsk;
-       while_each_thread(tsk, t) {
+       for_other_threads(tsk, t) {
                if (t->flags & PF_EXITING)
                        continue;