]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_yield.3
cexp2.3: Still not present in glibc 2.31
[thirdparty/man-pages.git] / man3 / pthread_yield.3
CommitLineData
fa94592d
MK
1.\" Copyright (c) 2009 Michael Kerrisk, <mtk.manpages@gmail.com>
2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fa94592d
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
12.\"
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
20.\"
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
fa94592d 24.\"
1c6f59c2 25.TH PTHREAD_YIELD 3 2017-11-26 "Linux" "Linux Programmer's Manual"
fa94592d
MK
26.SH NAME
27pthread_yield \- yield the processor
28.SH SYNOPSIS
29.nf
8231feb4 30.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fa94592d 31.B #include <pthread.h>
dbfe9c70 32.PP
fa94592d
MK
33.B int pthread_yield(void);
34.fi
68e4db0a 35.PP
fa94592d
MK
36Compile and link with \fI\-pthread\fP.
37.SH DESCRIPTION
38.BR pthread_yield ()
39causes the calling thread to relinquish the CPU.
40The thread is placed at the end of the run queue for its static
41priority and another thread is scheduled to run.
42For further details, see
43.BR sched_yield (2)
44.SH RETURN VALUE
45On success,
46.BR pthread_yield ()
47returns 0;
48on error, it returns an error number.
49.SH ERRORS
50On Linux, this call always succeeds
51(but portable and future-proof applications should nevertheless
52handle a possible error return).
aaa53a89 53.SH ATTRIBUTES
de96c7b6
PH
54For an explanation of the terms used in this section, see
55.BR attributes (7).
56.TS
57allbox;
58lb lb lb
59l l l.
60Interface Attribute Value
61T{
aaa53a89 62.BR pthread_yield ()
de96c7b6
PH
63T} Thread safety MT-Safe
64.TE
fa94592d 65.SH CONFORMING TO
c8f2dd47 66This call is nonstandard, but present on several other systems.
fa94592d
MK
67Use the standardized
68.BR sched_yield (2)
69instead.
70.\" e.g., the BSDs, Tru64, AIX, and Irix.
71.SH NOTES
72On Linux, this function is implemented as a call to
73.BR sched_yield (2).
46f2cf80
MK
74.PP
75.BR pthread_yield ()
cddd55a0 76is intended for use with real-time scheduling policies (i.e.,
46f2cf80
MK
77.BR SCHED_FIFO
78or
79.BR SCHED_RR ).
80Use of
81.BR pthread_yield ()
82with nondeterministic scheduling policies such as
83.BR SCHED_OTHER
84is unspecified and very likely means your application design is broken.
fa94592d 85.SH SEE ALSO
6c71aa3c 86.BR sched_yield (2),
41041696 87.\" FIXME . .BR pthread_cond_wait (3),
25ac8173
MK
88.BR pthreads (7),
89.BR sched (7)