linux shed_yield

NAME

sched_yield - yield the processor

SYNOPSIS

#include <sched.h>

int sched_yield(void);

DESCRIPTION

sched_yield() causes the calling thread to relinquish the CPU. The thread is moved to the end of the queue for its static priority and a new thread gets to run.

RETURN VALUE

On success, sched_yield() returns 0. On error, -1 is returned, and errno is set appropriately.

 

原文地址:https://www.cnblogs.com/tongyishu/p/13370183.html