Debian Codegraph @

upstream/debian-trixie/man3/pthread_equal.3

raw
1 '\" t
2 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
3 .\" <[email protected]>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH pthread_equal 3 2024-05-02 "Linux man-pages 6.9.1"
8 .SH NAME
9 pthread_equal \- compare thread IDs
10 .SH LIBRARY
11 POSIX threads library
12 .RI ( libpthread ", " \-lpthread )
13 .SH SYNOPSIS
14 .nf
15 .B #include <pthread.h>
16 .P
17 .BI "int pthread_equal(pthread_t " t1 ", pthread_t " t2 );
18 .fi
19 .SH DESCRIPTION
20 The
21 .BR pthread_equal ()
22 function compares two thread identifiers.
23 .SH RETURN VALUE
24 If the two thread IDs are equal,
25 .BR pthread_equal ()
26 returns a nonzero value; otherwise, it returns 0.
27 .SH ERRORS
28 This function always succeeds.
29 .SH ATTRIBUTES
30 For an explanation of the terms used in this section, see
31 .BR attributes (7).
32 .TS
33 allbox;
34 lbx lb lb
35 l l l.
36 Interface Attribute Value
37 T{
38 .na
39 .nh
40 .BR pthread_equal ()
41 T} Thread safety MT-Safe
42 .TE
43 .SH STANDARDS
44 POSIX.1-2008.
45 .SH HISTORY
46 POSIX.1-2001.
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)