mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
wifi_drv: call schedule() in sleep functions
The jiffies are only updated on each round of scheduling the runnable tasks. We have to schedule the current task that executes the sleep call to update the jiffies count and thereby preventing the task from entering an endless loop when using a statement like 'while (!time_after(jiffies, now + timeout)) { msleep(1); }'. Related to #1326.
This commit is contained in:
parent
9ed935ff2a
commit
4c7a5bb388
@ -1048,9 +1048,30 @@ int strict_strtoul(const char *s, unsigned int base, unsigned long *res)
|
||||
static Timer::Connection _timer;
|
||||
|
||||
|
||||
void udelay(unsigned long usecs) { _timer.usleep(usecs); }
|
||||
void usleep_range(unsigned long min, unsigned long max) { _timer.usleep(min); }
|
||||
void msleep(unsigned int msecs) { _timer.msleep(msecs); }
|
||||
void udelay(unsigned long usecs)
|
||||
{
|
||||
_timer.usleep(usecs);
|
||||
|
||||
Lx::scheduler().current()->schedule();
|
||||
}
|
||||
|
||||
|
||||
void usleep_range(unsigned long min, unsigned long max)
|
||||
{
|
||||
_timer.usleep(min);
|
||||
|
||||
Lx::scheduler().current()->schedule();
|
||||
}
|
||||
|
||||
|
||||
void msleep(unsigned int msecs)
|
||||
{
|
||||
_timer.msleep(msecs);
|
||||
|
||||
Lx::scheduler().current()->schedule();
|
||||
}
|
||||
|
||||
|
||||
void mdelay(unsigned long msecs) { msleep(msecs); }
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user