From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: mixxel@cs.auc.dk, Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: workqueue and pending
Date: Tue, 04 May 2004 13:55:51 +1000 [thread overview]
Message-ID: <1083642950.29596.299.camel@gaston> (raw)
In-Reply-To: <20040503201616.6f3b8700.akpm@osdl.org>
> static inline int cancel_delayed_work(struct work_struct *work)
> {
> - return del_timer_sync(&work->timer);
> + int ret;
> +
> + ret = del_timer_sync(&work->timer);
> + if (ret)
> + clear_bit(0, &work->pending);
> + return ret;
> }
Heh, I was trying to figure out a simple way to do that and just
didn't figure out del_timer_sync() would actually have a useful
return value :)
It's probably still good to precise explicitely in the comments
that upon return of cancel_delayed_work(), the work queue might
still be pending and that a flush and whoever called this may
still need a flush_scheduled_work() or flush_workqueue() (provided
it's running in a context where that can sleep)
Ben.
next prev parent reply other threads:[~2004-05-04 3:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-03 11:39 workqueue and pending Mikkel Christiansen
2004-05-03 23:27 ` Andrew Morton
2004-05-04 2:51 ` Benjamin Herrenschmidt
2004-05-04 3:16 ` Andrew Morton
2004-05-04 3:55 ` Benjamin Herrenschmidt [this message]
2004-05-04 4:15 ` Andrew Morton
2004-05-04 4:41 ` Benjamin Herrenschmidt
2004-05-04 13:36 ` Mikkel Christiansen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1083642950.29596.299.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mixxel@cs.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.