lkml.org 
[lkml]   [1999]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Scheduling inside bottom-half

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/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.039 / U:0.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site