'\" t .\" Title: kthread_stop .\" 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_STOP" "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_stop \- stop a thread created by \fBkthread_create\fR\&. .SH "SYNOPSIS" .HP \w'int\ kthread_stop('u .BI "int kthread_stop(struct\ task_struct\ *\ " "k" ");" .SH "ARGUMENTS" .PP \fIk\fR .RS 4 thread created by \fBkthread_create\fR\&. .RE .SH "DESCRIPTION" .PP Sets \fBkthread_should_stop\fR for \fIk\fR to return true, wakes it, and waits for it to exit\&. This can also be called after \fBkthread_create\fR instead of calling \fBwake_up_process\fR: the thread will exit without calling \fBthreadfn\fR\&. .PP If \fBthreadfn\fR may call \fBdo_exit\fR itself, the caller must ensure task_struct can\*(Aqt go away\&. .PP Returns the result of \fBthreadfn\fR, or \fB\-EINTR\fR if \fBwake_up_process\fR was never called\&. .SH "COPYRIGHT" .br