---
name: "mod_timer"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mod_timer"
---

# mod\_timer(9)

modify a timer's timeout

## NAME

mod\_timer - modify a timer's timeout

## SYNOPSIS

**int mod\_timer(struct timer\_list \*** *timer***, unsigned long** *expires***);**

## ARGUMENTS

*timer*

the timer to be modified

*expires*

new timeout in jiffies

## DESCRIPTION

**mod\_timer** is a more efficient way to update the expire field of an active timer (if the timer is inactive it will be activated)

mod\_timer(timer, expires) is equivalent to:

del\_timer(timer); timer-\>expires = expires; add\_timer(timer);

Note that if there are multiple unserialized concurrent users of the same timer, then **mod\_timer** is the only safe way to modify the timeout, since **add\_timer** cannot modify an already running timer.

The function returns whether it has modified a pending timer or not. (ie. **mod\_timer** of an inactive timer returns 0, **mod\_timer** of an active timer returns 1.)

## COPYRIGHT
