Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98397
b: refs/heads/master
c: bb10ed0
h: refs/heads/master
i:
  98395: 00c176f
v: v3
  • Loading branch information
Roland Dreier authored and Ingo Molnar committed Jun 20, 2008
1 parent 1cfc9a4 commit f619af1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a8cde163ea724baf74e7752a31a69d3121a240e
refs/heads/master: bb10ed0994927d433f6dbdf274fdb26cfcf516b7
10 changes: 10 additions & 0 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4405,6 +4405,16 @@ do_wait_for_common(struct completion *x, long timeout, int 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;
Expand Down

0 comments on commit f619af1

Please sign in to comment.