spin-wait based kernel timer (for futex() timeout) implementation

This commit is contained in:
Balazs Gerofi bgerofi@riken.jp
2012-11-28 15:22:53 +09:00
parent b59e36e1a5
commit 092069fd80
6 changed files with 121 additions and 19 deletions

View File

@ -242,11 +242,14 @@ static int futex_wait(uint32_t __user *uaddr, uint32_t val,
queue_unlock(queue, irqflags);
if (!list_empty(&futex.link)) {
// We don't have timers for now, let's sleep forever,
// and pretend we were woken up
//time_remain = schedule_timeout(timeout);
schedule();
time_remain = 10;
if (timeout) {
time_remain = schedule_timeout(timeout);
}
else {
schedule();
time_remain = 0;
}
}
cpu_local_var(current)->status = PS_RUNNING;