forked from len0rd/rockbox
sleep() always sleeps at least one tick
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@509 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b900a83046
commit
48d38d918f
1 changed files with 4 additions and 4 deletions
|
@ -37,12 +37,12 @@ void kernel_init(void)
|
|||
|
||||
void sleep(int ticks)
|
||||
{
|
||||
int timeout = current_tick + ticks;
|
||||
/* Always sleep at least 1 tick */
|
||||
int timeout = current_tick + ticks + 1;
|
||||
|
||||
/* always yield at least once */
|
||||
do {
|
||||
while (TIME_BEFORE( current_tick, timeout )) {
|
||||
yield();
|
||||
} while (TIME_BEFORE( current_tick, timeout ));
|
||||
}
|
||||
}
|
||||
|
||||
void yield(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue