]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/pthread_yield.3
man*/: ffix (un-bracket tables)
[thirdparty/man-pages.git] / man3 / pthread_yield.3
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>
16 .PP
17 .B [[deprecated]] int pthread_yield(void);
18 .fi
19 .SH DESCRIPTION
20 .BR Note :
21 This function is deprecated; see below.
22 .PP
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
46 T{
47 .na
48 .nh
49 .BR pthread_yield ()
50 T} Thread safety MT-Safe
51 .TE
52 .sp 1
53 .SH VERSIONS
54 On Linux, this function is implemented as a call to
55 .BR sched_yield (2).
56 .SH STANDARDS
57 None.
58 .SH HISTORY
59 .\" BSD, Tru64, AIX, and Irix.
60 Deprecated since glibc 2.34.
61 Use the standardized
62 .BR sched_yield (2)
63 instead.
64 .SH NOTES
65 .BR pthread_yield ()
66 is intended for use with real-time scheduling policies (i.e.,
67 .B SCHED_FIFO
68 or
69 .BR SCHED_RR ).
70 Use of
71 .BR pthread_yield ()
72 with nondeterministic scheduling policies such as
73 .B SCHED_OTHER
74 is unspecified and very likely means your application design is broken.
75 .SH SEE ALSO
76 .BR sched_yield (2),
77 .\" FIXME . .BR pthread_cond_wait (3),
78 .BR pthreads (7),
79 .BR sched (7)