Busy waiting _is_ bad. Timers are easy :
struct timer_list my_timer;
...
my_timer.expires = jiffes + HZ;
my_timer.function = my_timer_handler;
my_timer.data = data_pointer_whatever
add_timer(&my_timer);
void my_timer_handler(unsigned long data)
{
printk("wuhu\n");
}
my_timer_handler receives the .data as an argument, so you can
use the same handler for multiple timers. Remember to del_timer()
also!
-- * Jens Axboe <axboe@image.dk> * Linux CD-ROM Maintainer * http://www.kernel.dk- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/