]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_yield.3
futex.2, netlink.3, stdin.3, wavelan.4, netlink.7: srcfix
[thirdparty/man-pages.git] / man3 / pthread_yield.3
CommitLineData
fa94592d
MK
1.\" Copyright (c) 2009 Michael Kerrisk, <mtk.manpages@gmail.com>
2.\"
3.\" Permission is granted to make and distribute verbatim copies of this
4.\" manual provided the copyright notice and this permission notice are
5.\" preserved on all copies.
6.\"
7.\" Permission is granted to copy and distribute modified versions of this
8.\" manual under the conditions for verbatim copying, provided that the
9.\" entire resulting derived work is distributed under the terms of a
10.\" permission notice identical to this one.
11.\"
12.\" Since the Linux kernel and libraries are constantly changing, this
13.\" manual page may be incorrect or out-of-date. The author(s) assume no
14.\" responsibility for errors or omissions, or for damages resulting from
15.\" the use of the information contained herein. The author(s) may not
16.\" have taken the same level of care in the production of this manual,
17.\" which is licensed free of charge, as they might when working
18.\" professionally.
19.\"
20.\" Formatted or processed versions of this manual, if unaccompanied by
21.\" the source, must acknowledge the copyright and authors of this work.
22.\"
fee1593e 23.TH PTHREAD_YIELD 3 2013-03-05 "Linux" "Linux Programmer's Manual"
fa94592d
MK
24.SH NAME
25pthread_yield \- yield the processor
26.SH SYNOPSIS
27.nf
8231feb4 28.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fa94592d
MK
29.B #include <pthread.h>
30
31.B int pthread_yield(void);
32.fi
33.sp
34Compile and link with \fI\-pthread\fP.
35.SH DESCRIPTION
36.BR pthread_yield ()
37causes the calling thread to relinquish the CPU.
38The thread is placed at the end of the run queue for its static
39priority and another thread is scheduled to run.
40For further details, see
41.BR sched_yield (2)
42.SH RETURN VALUE
43On success,
44.BR pthread_yield ()
45returns 0;
46on error, it returns an error number.
47.SH ERRORS
48On Linux, this call always succeeds
49(but portable and future-proof applications should nevertheless
50handle a possible error return).
51.SH CONFORMING TO
c8f2dd47 52This call is nonstandard, but present on several other systems.
fa94592d
MK
53Use the standardized
54.BR sched_yield (2)
55instead.
56.\" e.g., the BSDs, Tru64, AIX, and Irix.
57.SH NOTES
58On Linux, this function is implemented as a call to
59.BR sched_yield (2).
60.SH SEE ALSO
61.BR sched_setscheduler (2),
6c71aa3c 62.BR sched_yield (2),
fa94592d 63.BR pthreads (7)