'\" t .\" Title: mod_timer .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "MOD_TIMER" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" mod_timer \- modify a timer\*(Aqs timeout .SH "SYNOPSIS" .HP \w'int\ mod_timer('u .BI "int mod_timer(struct\ timer_list\ *\ " "timer" ", unsigned\ long\ " "expires" ");" .SH "ARGUMENTS" .PP \fItimer\fR .RS 4 the timer to be modified .RE .PP \fIexpires\fR .RS 4 new timeout in jiffies .RE .SH "DESCRIPTION" .PP \fBmod_timer\fR is a more efficient way to update the expire field of an active timer (if the timer is inactive it will be activated) .PP mod_timer(timer, expires) is equivalent to: .PP del_timer(timer); timer\->expires = expires; add_timer(timer); .PP Note that if there are multiple unserialized concurrent users of the same timer, then \fBmod_timer\fR is the only safe way to modify the timeout, since \fBadd_timer\fR cannot modify an already running timer\&. .PP The function returns whether it has modified a pending timer or not\&. (ie\&. \fBmod_timer\fR of an inactive timer returns 0, \fBmod_timer\fR of an active timer returns 1\&.) .SH "COPYRIGHT" .br