Debian Codegraph @

upstream/debian-unstable/man3/pthread_equal.3

raw
1 '\" t
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH pthread_equal 3 2025-05-17 "Linux man-pages 6.18"
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 .P
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 .TS
32 allbox;
33 lbx lb lb
34 l l l.
35 Interface Attribute Value
36 T{
37 .na
38 .nh
39 .BR pthread_equal ()
40 T} Thread safety MT-Safe
41 .TE
42 .SH STANDARDS
43 POSIX.1-2008.
44 .SH HISTORY
45 POSIX.1-2001.
46 .SH NOTES
47 The
48 .BR pthread_equal ()
49 function is necessary because thread IDs should be considered opaque:
50 there is no portable way for applications to directly compare two
51 .I pthread_t
52 values.
53 .SH SEE ALSO
54 .BR pthread_create (3),
55 .BR pthread_self (3),
56 .BR pthreads (7)