From: Tejun Heo Date: Fri, 3 Aug 2012 17:30:47 +0000 (-0700) Subject: workqueue: implement mod_delayed_work[_on]() X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~52^2~35 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8376fe22c7e79c7e90857d39f82aeae6cad6c4b8;p=pandora-kernel.git workqueue: implement mod_delayed_work[_on]() Workqueue was lacking a mechanism to modify the timeout of an already pending delayed_work. delayed_work users have been working around this using several methods - using an explicit timer + work item, messing directly with delayed_work->timer, and canceling before re-queueing, all of which are error-prone and/or ugly. This patch implements mod_delayed_work[_on]() which behaves similarly to mod_timer() - if the delayed_work is idle, it's queued with the given delay; otherwise, its timeout is modified to the new value. Zero @delay guarantees immediate execution. v2: Updated to reflect try_to_grab_pending() changes. Now safe to be called from bh context. Signed-off-by: Tejun Heo Cc: Linus Torvalds Cc: Andrew Morton Cc: Ingo Molnar --- Reading git-diff-tree failed