1MOD_TIMER(9)                     Driver Basics                    MOD_TIMER(9)
2
3
4

NAME

6       mod_timer - modify a timer's timeout
7

SYNOPSIS

9       int mod_timer(struct timer_list * timer, unsigned long expires);
10

ARGUMENTS

12       timer
13           the timer to be modified
14
15       expires
16           new timeout in jiffies
17

DESCRIPTION

19       mod_timer is a more efficient way to update the expire field of an
20       active timer (if the timer is inactive it will be activated)
21
22       mod_timer(timer, expires) is equivalent to:
23
24       del_timer(timer); timer->expires = expires; add_timer(timer);
25
26       Note that if there are multiple unserialized concurrent users of the
27       same timer, then mod_timer is the only safe way to modify the timeout,
28       since add_timer cannot modify an already running timer.
29
30       The function returns whether it has modified a pending timer or not.
31       (ie.  mod_timer of an inactive timer returns 0, mod_timer of an active
32       timer returns 1.)
33
35Kernel Hackers Manual 3.10         June 2019                      MOD_TIMER(9)
Impressum