del_timer[_sync]

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

 



Hi all,

I have a timer that fires every $X seconds while the module is loaded.
I want to stop and remove the timer upon module unload. What is the
proper way to accomplish this?

In the module's __exit function, I am using this code to remove the timer:

[...]
del_timer_sync( &timer);
if (timer_pending( &timer))
       del_timer( &timer);
[...]

Is this the right way, or unnecessary overkill? I've seen multiple
ideas on how best to properly remove a timer. Thanks in advance! :)

-- 
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux