Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98398
b: refs/heads/master
c: ea71a54
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 20, 2008
1 parent f619af1 commit 043af72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb10ed0994927d433f6dbdf274fdb26cfcf516b7
refs/heads/master: ea71a546706dfdad72462624394e1e472c6bf34f
24 changes: 6 additions & 18 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4398,32 +4398,20 @@ do_wait_for_common(struct completion *x, long timeout, int state)
signal_pending(current)) ||
(state == TASK_KILLABLE &&
fatal_signal_pending(current))) {
__remove_wait_queue(&x->wait, &wait);
return -ERESTARTSYS;
timeout = -ERESTARTSYS;
break;
}
__set_current_state(state);
spin_unlock_irq(&x->wait.lock);
timeout = schedule_timeout(timeout);
spin_lock_irq(&x->wait.lock);

/*
* If the completion has arrived meanwhile
* then return 1 jiffy time left:
*/
if (x->done && !timeout) {
timeout = 1;
break;
}

if (!timeout) {
__remove_wait_queue(&x->wait, &wait);
return timeout;
}
} while (!x->done);
} while (!x->done && timeout);
__remove_wait_queue(&x->wait, &wait);
if (!x->done)
return timeout;
}
x->done--;
return timeout;
return timeout ?: 1;
}

static long __sched
Expand Down

0 comments on commit 043af72

Please sign in to comment.