OSDN Git Service

LDP: Update original to LDP v3.68
[linuxjm/LDP_man-pages.git] / original / man3 / pthread_yield.3
1 .\" Copyright (c) 2009 Michael Kerrisk, <mtk.manpages@gmail.com>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
23 .\" %%%LICENSE_END
24 .\"
25 .TH PTHREAD_YIELD 3 2014-05-13 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 pthread_yield \- yield the processor
28 .SH SYNOPSIS
29 .nf
30 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
31 .B #include <pthread.h>
32
33 .B int pthread_yield(void);
34 .fi
35 .sp
36 Compile and link with \fI\-pthread\fP.
37 .SH DESCRIPTION
38 .BR pthread_yield ()
39 causes the calling thread to relinquish the CPU.
40 The thread is placed at the end of the run queue for its static
41 priority and another thread is scheduled to run.
42 For further details, see
43 .BR sched_yield (2)
44 .SH RETURN VALUE
45 On success,
46 .BR pthread_yield ()
47 returns 0;
48 on error, it returns an error number.
49 .SH ERRORS
50 On Linux, this call always succeeds
51 (but portable and future-proof applications should nevertheless
52 handle a possible error return).
53 .SH ATTRIBUTES
54 .SS Multithreading (see pthreads(7))
55 The
56 .BR pthread_yield ()
57 function is thread-safe.
58 .SH CONFORMING TO
59 This call is nonstandard, but present on several other systems.
60 Use the standardized
61 .BR sched_yield (2)
62 instead.
63 .\" e.g., the BSDs, Tru64, AIX, and Irix.
64 .SH NOTES
65 On Linux, this function is implemented as a call to
66 .BR sched_yield (2).
67 .SH SEE ALSO
68 .BR sched_yield (2),
69 .BR pthreads (7),
70 .BR sched (7)
71 .SH COLOPHON
72 This page is part of release 3.68 of the Linux
73 .I man-pages
74 project.
75 A description of the project,
76 information about reporting bugs,
77 and the latest version of this page,
78 can be found at
79 \%http://www.kernel.org/doc/man\-pages/.