Yields execution to another thread (P1003.1b).
sched_yield();
#include#include int sched_yield ( void);
If no other thread is runnable at the priority of the caller, the caller continues to run.
Threads with higher priority are allowed to preempt the running thread, so the sched_yield function has no effect on the scheduling of higher- or lower-priority threads.
No special privileges are needed to use the sched_yield function.
Return Description0 Successful completion. -1 Unsuccessful completion - errno is set to indicate that an error occurred. [ENOSYS] The function sched_yield is not supported by this implementation.
pthread_attr_setschedparam pthread_setschedparam pthread_getscheduler pthread_setscheduler