mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@suse.de>, Ingo Molnar <mingo@elte.hu>
Subject: [PATCH 2.6.30] schedule_work() documentation improvements
Date: Thu, 30 Jul 2009 19:00:53 +0200	[thread overview]
Message-ID: <200907301900.54202.bart.vanassche@gmail.com> (raw)

Two important aspects of the schedule_work() function are not yet documented:
- that it is allowed to pass a struct work_struct * to this function that
  is already on the kernel-global workqueue;
- the meaning of its return value.
The patch below documents both aspects.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>

diff -uprN orig/linux-2.6.30/kernel/workqueue.c linux-2.6.30/kernel/workqueue.c
--- orig/linux-2.6.30/kernel/workqueue.c	2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30/kernel/workqueue.c	2009-07-30 18:58:07.000000000 +0200
@@ -603,7 +603,11 @@ static struct workqueue_struct *keventd_
  * schedule_work - put work task in global workqueue
  * @work: job to be done
  *
- * This puts a job in the kernel-global workqueue.
+ * Returns zero if @work was already on the kernel-global workqueue and
+ * non-zero otherwise.
+ *
+ * This puts a job in the kernel-global workqueue if it was not already queued
+ * and leaves it in the same position on the kernel-global workqueue otherwise.
  */
 int schedule_work(struct work_struct *work)
 {

             reply	other threads:[~2009-07-30 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 17:00 Bart Van Assche [this message]
2009-08-04 14:15 ` [tip:core/cleanups] workqueues: Improve schedule_work() documentation tip-bot for Bart Van Assche

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=200907301900.54202.bart.vanassche@gmail.com \
    --to=bart.vanassche@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome