]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] timers: introduce try_to_del_timer_sync()
authorOleg Nesterov <oleg@tv-sign.ru>
Thu, 23 Jun 2005 07:08:59 +0000 (00:08 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 23 Jun 2005 16:45:16 +0000 (09:45 -0700)
commit6eebc43efa6b7ebf2d674281cc55bdb4e7f56a90
treee747348f7d3c9f1615963dde4f2c8baaf842415f
parent5ff25897f2297ae6af58457370f10007cac5fde7
[PATCH] timers: introduce try_to_del_timer_sync()

This patch splits del_timer_sync() into 2 functions.  The new one,
try_to_del_timer_sync(), returns -1 when it hits executing timer.

It can be used in interrupt context, or when the caller hold locks which
can prevent completion of the timer's handler.

NOTE.  Currently it can't be used in interrupt context in UP case, because
->running_timer is used only with CONFIG_SMP.

Should the need arise, it is possible to kill #ifdef CONFIG_SMP in
set_running_timer(), it is cheap.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/timer.h
kernel/timer.c