Re: Scheduling inside bottom-half

Linux Lists (lists@cyclades.com)
Thu, 30 Sep 1999 14:37:11 -0700 (PDT)


On Thu, 30 Sep 1999, Jens Axboe wrote:
>
> 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!

In my case, the my_timer_handler function will generate an interrupt. Do I
need to protect the function (with save_flags/cli/restore_flags or
spin_locks) or are kernel timer functions already protected?

Another question: can I del_timer from inside my_timer_handler?

Regards,
Ivan

-
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/