From ad0793f515e6c0e7bf02882676ad7a9833e0c85a Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sat, 5 Sep 2009 11:17:06 -0700 Subject: [PATCH] --- yaml --- r: 157192 b: refs/heads/master c: 4e49627b9bc29a14b393c480e8c979e3bc922ef7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/workqueue.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8385f5cc4691..9d48e9a73482 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 37d0892c5a94e208cf863e3b7bac014edee4346d +refs/heads/master: 4e49627b9bc29a14b393c480e8c979e3bc922ef7 diff --git a/trunk/include/linux/workqueue.h b/trunk/include/linux/workqueue.h index 13e1adf55c4c..6273fa97b527 100644 --- a/trunk/include/linux/workqueue.h +++ b/trunk/include/linux/workqueue.h @@ -240,6 +240,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) return ret; } +/* + * Like above, but uses del_timer() instead of del_timer_sync(). This means, + * if it returns 0 the timer function may be running and the queueing is in + * progress. + */ +static inline int __cancel_delayed_work(struct delayed_work *work) +{ + int ret; + + ret = del_timer(&work->timer); + if (ret) + work_clear_pending(&work->work); + return ret; +} + extern int cancel_delayed_work_sync(struct delayed_work *work); /* Obsolete. use cancel_delayed_work_sync() */