History

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.

Bart Van Assche committed 17 years ago

Commit 5b0f4371 parent a33a0521 file · +6 −1Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+6−1
@@ -600,7 +600,12 @@ static struct workqueue_struct *keventd_wq __read_mostly; · 599 unmodified lines
600 * schedule_work - put work task in global workqueue600 * schedule_work - put work task in global workqueue
601 * @work: job to be done601 * @work: job to be done
602 *602 *
603 * This puts a job in the kernel-global workqueue.603 * Returns zero if @work was already on the kernel-global workqueue and
604 * non-zero otherwise.
605 *
606 * This puts a job in the kernel-global workqueue if it was not already
607 * queued and leaves it in the same position on the kernel-global
608 * workqueue otherwise.
604 */609 */
605int schedule_work(struct work_struct *work)610int schedule_work(struct work_struct *work)
606{611{