Re: kernel timer problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 19, 2009 at 5:24 AM, Saransh Mittal <saransh.m@xxxxxxxxx> wrote:
(cut)
> /* Inside init_module */
> init_timer ( &TimerFunctionTimer );
> TimerFunctionTimer.expires = (jiffies + HZ);
> TimerFunctionTimer.function = timerFunction;
> add_timer( &TimerFunctionTimer );


You could also do something like this:

static void my_timer_f(unsigned long data) {
}

static struct timer_list my_timer = TIMER_INITIALIZER(my_timer_f, 0, 0);

  /* Schedule timer. */
  mod_timer(&my_timer, jiffies + HZ);

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux