]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/pthread_equal.3
7ccab5d1ab30e3689dc072b084bbfc68b09df1c5
[thirdparty/man-pages.git] / man3 / pthread_equal.3
1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH PTHREAD_EQUAL 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
7 .SH NAME
8 pthread_equal \- compare thread IDs
9 .SH LIBRARY
10 POSIX threads library
11 .RI ( libpthread ", " \-lpthread )
12 .SH SYNOPSIS
13 .nf
14 .B #include <pthread.h>
15 .PP
16 .BI "int pthread_equal(pthread_t " t1 ", pthread_t " t2 );
17 .fi
18 .SH DESCRIPTION
19 The
20 .BR pthread_equal ()
21 function compares two thread identifiers.
22 .SH RETURN VALUE
23 If the two thread IDs are equal,
24 .BR pthread_equal ()
25 returns a nonzero value; otherwise, it returns 0.
26 .SH ERRORS
27 This function always succeeds.
28 .SH ATTRIBUTES
29 For an explanation of the terms used in this section, see
30 .BR attributes (7).
31 .ad l
32 .nh
33 .TS
34 allbox;
35 lbx lb lb
36 l l l.
37 Interface Attribute Value
38 T{
39 .BR pthread_equal ()
40 T} Thread safety MT-Safe
41 .TE
42 .hy
43 .ad
44 .sp 1
45 .SH STANDARDS
46 POSIX.1-2001, POSIX.1-2008.
47 .SH NOTES
48 The
49 .BR pthread_equal ()
50 function is necessary because thread IDs should be considered opaque:
51 there is no portable way for applications to directly compare two
52 .I pthread_t
53 values.
54 .SH SEE ALSO
55 .BR pthread_create (3),
56 .BR pthread_self (3),
57 .BR pthreads (7)