From: Bart Van Assche Date: Thu, 30 Jul 2009 17:00:53 +0000 (+0200) Subject: workqueues: Improve schedule_work() documentation X-Git-Tag: upstream/snapshot3+hdmi~17698^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b0f437df0a3e374d26ad533eb78fe64744f55a8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git workqueues: Improve schedule_work() documentation 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 Cc: "Greg Kroah-Hartman" Cc: Andrew Morton LKML-Reference: <200907301900.54202.bart.vanassche@gmail.com> Signed-off-by: Ingo Molnar --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 0668795..3c44b56 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -600,7 +600,12 @@ static struct workqueue_struct *keventd_wq __read_mostly; * 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) {