---
name: "kthread_stop"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/kthread_stop"
---

# kthread\_stop(9)

stop a thread created by kthread\_create.

## NAME

kthread\_stop - stop a thread created by **kthread\_create**.

## SYNOPSIS

**int kthread\_stop(struct task\_struct \*** *k***);**

## ARGUMENTS

*k*

thread created by **kthread\_create**.

## DESCRIPTION

Sets **kthread\_should\_stop** for *k* to return true, wakes it, and waits for it to exit. This can also be called after **kthread\_create** instead of calling **wake\_up\_process**: the thread will exit without calling **threadfn**.

If **threadfn** may call **do\_exit** itself, the caller must ensure task\_struct can't go away.

Returns the result of **threadfn**, or **-EINTR** if **wake\_up\_process** was never called.

## COPYRIGHT
