You can do:
set_current_state(TASK_RUNNING);
schedule();
I'm not clear on what you are guaranteed to get - for example,
it looks as if it can sometimes return without sleeping at all.
There is also cond_resched(), which is
static inline void cond_resched(void)
{
if (need_resched())
__cond_resched();
}
void __cond_resched(void)
{
set_current_state(TASK_RUNNING);
schedule();
}
I don't know when need_resched evaluates to true, I haven't
had time to look into this yet.
Ciao, Duncan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/