---
name: "yield_to"
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/yield_to"
---

# yield\_to(9)

yield the current processor to another thread in your thread group, or accelerate that thread toward the processor it's on.

## NAME

yield\_to - yield the current processor to another thread in your thread group, or accelerate that thread toward the processor it's on.

## SYNOPSIS

**int \_\_sched yield\_to(struct task\_struct \*** *p***, bool** *preempt***);**

## ARGUMENTS

*p*

target task

*preempt*

whether task preemption is allowed or not

## DESCRIPTION

It's the caller's job to ensure that the target task struct can't go away on us before we can do any checks.

## RETURN

true (\>0) if we indeed boosted the target task. false (0) if we failed to boost the target. -ESRCH if there's no task to yield to.

## COPYRIGHT
