tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / pthread_yield.3
blob37263d0c7235b6f2f3eb54964052f754dc3e905f
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 VERSIONS
39 Since glibc 2.34, this function is marked as deprecated.
40 .SH ATTRIBUTES
41 For an explanation of the terms used in this section, see
42 .BR attributes (7).
43 .ad l
44 .nh
45 .TS
46 allbox;
47 lbx lb lb
48 l l l.
49 Interface       Attribute       Value
51 .BR pthread_yield ()
52 T}      Thread safety   MT-Safe
53 .TE
54 .hy
55 .ad
56 .sp 1
57 .SH STANDARDS
58 This call is nonstandard, but present on several other systems.
59 Use the standardized
60 .BR sched_yield (2)
61 instead.
62 .\" e.g., the BSDs, Tru64, AIX, and Irix.
63 .SH NOTES
64 On Linux, this function is implemented as a call to
65 .BR sched_yield (2).
66 .PP
67 .BR pthread_yield ()
68 is intended for use with real-time scheduling policies (i.e.,
69 .B SCHED_FIFO
71 .BR SCHED_RR ).
72 Use of
73 .BR pthread_yield ()
74 with nondeterministic scheduling policies such as
75 .B SCHED_OTHER
76 is unspecified and very likely means your application design is broken.
77 .SH SEE ALSO
78 .BR sched_yield (2),
79 .\" FIXME . .BR pthread_cond_wait (3),
80 .BR pthreads (7),
81 .BR sched (7)