'\" t .\" Title: kthread_worker_fn .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "KTHREAD_WORKER_FN" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" kthread_worker_fn \- kthread function to process kthread_worker .SH "SYNOPSIS" .HP \w'int\ kthread_worker_fn('u .BI "int kthread_worker_fn(void\ *\ " "worker_ptr" ");" .SH "ARGUMENTS" .PP \fIworker_ptr\fR .RS 4 pointer to initialized kthread_worker .RE .SH "DESCRIPTION" .PP This function can be used as \fIthreadfn\fR to \fBkthread_create\fR or \fBkthread_run\fR with \fIworker_ptr\fR argument pointing to an initialized kthread_worker\&. The started kthread will process work_list until the it is stopped with \fBkthread_stop\fR\&. A kthread can also call this function directly after extra initialization\&. .PP Different kthreads can be used for the same kthread_worker as long as there\*(Aqs only one kthread attached to it at any given time\&. A kthread_worker without an attached kthread simply collects queued kthread_works\&. .SH "COPYRIGHT" .br