1
0
Fork 0
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:
Linus Nielsen Feltzing 2002-05-08 08:41:19 +00:00
parent b900a83046
commit 48d38d918f

View file

@ -37,12 +37,12 @@ void kernel_init(void)
void sleep(int ticks) 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 */ while (TIME_BEFORE( current_tick, timeout )) {
do {
yield(); yield();
} while (TIME_BEFORE( current_tick, timeout )); }
} }
void yield(void) void yield(void)