Re: del_timer()

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

 






Hi,

  My doubt was --- can I call del_timer for a timer for which I had NOT
called add_timer ?, in this case the del_timer simply returns a 0, or is
this an error and should NOT be done ?
I ask this, becasue as I see it, there is no way to see if a timer is
running, (something like pending_timer, it is not exported) and then call
del_timer.

regards
Amit




Tyler <tyler@agat.net>@nl.linux.org on 06/10/2004 01:14:13 AM

Sent by:    kernelnewbies-bounce@nl.linux.org


To:    kernelnewbies@nl.linux.org
cc:

Subject:    Re: del_timer()


aksingh@hss.hns.com wrote:
>
>
>
> HI,
>
>  Can I call a del_timer() on a timer that is not currently running ? Is
> this an error, i believe if del_timer returns 1 that means the timer was
> running, if it returns zero, it wasnt running , right ?
>
> thanks
> Amit
>
A timer is automatically deleted when it ends up or if you call
del_timer. You should use del_timer_sync to avoid race conditions (in
the case that the timer ends up when the function del_timer is executed).
And if the base timer is not set, then del_timer returns 0 and the timer
isn't deleted and otherwise it effectively delete the timer.


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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