[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I make a kernel module "sleep" without affecting other kernel modules?
> Just use schedule_timeout() if you want to do something like this.
>
> thanks,
>
> greg k-h
>
Yes, that's more or less what I did :
void whatever_function ()
{
/* some stuff happens here, and I have to wait for a few ticks after this */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout ( no_of_ticks );
/* done watiting, continue with whatever I have to do */
}
I wonder if it's bad practice to set current->state directly instead
of using a function like set_current_state (like the way msleep does
in the current kernel source) ?
Thank you, Everybody, for your replies :-).
Karthik.
--
There are things known and things unknown, in between lie the Doors
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/