]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: cancel_delayed_work() should return %false if work item is idle
authorDan Magenheimer <dan.magenheimer@oracle.com>
Thu, 18 Oct 2012 23:31:37 +0000 (16:31 -0700)
committerTejun Heo <tj@kernel.org>
Wed, 24 Oct 2012 19:38:16 +0000 (12:38 -0700)
commit12cbccb22be0a12b64e4a1df12339ab04652c823
tree2ce9ff8057b9273905424b2932b35a080cfdbf38
parent0d577442d51c1c4ffe9f108f9f6058d85b2c42c9
workqueue: cancel_delayed_work() should return %false if work item is idle

40eb19e400 ("workqueue: reimplement cancel_delayed_work() using
try_to_grab_pending()") made cancel_delayed_work() always return %true
unless someone else is also trying to cancel the work item, which is
broken - if the target work item is idle, the return value should be
%false.

try_to_grab_pending() indicates that the target work item was idle by
zero return value.  Use it for return.  Note that this brings
cancel_delayed_work() in line with __cancel_work_timer() in return
value handling.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
LKML-Reference: <444a6439-b1a4-4740-9e7e-bc37267cfe73@default>
kernel/workqueue.c