share/mk/: build-html: Don't build mbind.2 and set_mempolicy.2
[man-pages.git] / man3 / pthread_yield.3
blobb0a6768d8bddb1a2f096977e2d615eaca41419d5
1 '\" t
2 .\" Copyright (c) 2009 Michael Kerrisk, <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH pthread_yield 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 pthread_yield \- yield the processor
9 .SH LIBRARY
10 POSIX threads library
11 .RI ( libpthread ", " \-lpthread )
12 .SH SYNOPSIS
13 .nf
14 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
15 .B #include <pthread.h>
17 .B [[deprecated]] int pthread_yield(void);
18 .fi
19 .SH DESCRIPTION
20 .BR Note :
21 This function is deprecated; see below.
23 .BR pthread_yield ()
24 causes the calling thread to relinquish the CPU.
25 The thread is placed at the end of the run queue for its static
26 priority and another thread is scheduled to run.
27 For further details, see
28 .BR sched_yield (2)
29 .SH RETURN VALUE
30 On success,
31 .BR pthread_yield ()
32 returns 0;
33 on error, it returns an error number.
34 .SH ERRORS
35 On Linux, this call always succeeds
36 (but portable and future-proof applications should nevertheless
37 handle a possible error return).
38 .SH ATTRIBUTES
39 For an explanation of the terms used in this section, see
40 .BR attributes (7).
41 .TS
42 allbox;
43 lbx lb lb
44 l l l.
45 Interface       Attribute       Value
47 .na
48 .nh
49 .BR pthread_yield ()
50 T}      Thread safety   MT-Safe
51 .TE
52 .SH VERSIONS
53 On Linux, this function is implemented as a call to
54 .BR sched_yield (2).
55 .SH STANDARDS
56 None.
57 .SH HISTORY
58 .\" BSD, Tru64, AIX, and Irix.
59 Deprecated since glibc 2.34.
60 Use the standardized
61 .BR sched_yield (2)
62 instead.
63 .SH NOTES
64 .BR pthread_yield ()
65 is intended for use with real-time scheduling policies (i.e.,
66 .B SCHED_FIFO
68 .BR SCHED_RR ).
69 Use of
70 .BR pthread_yield ()
71 with nondeterministic scheduling policies such as
72 .B SCHED_OTHER
73 is unspecified and very likely means your application design is broken.
74 .SH SEE ALSO
75 .BR sched_yield (2),
76 .\" FIXME . .BR pthread_cond_wait (3),
77 .BR pthreads (7),
78 .BR sched (7)