1PTHREAD_EQUAL(3) Linux Programmer's Manual PTHREAD_EQUAL(3)
2
3
4
6 pthread_equal - compare thread IDs
7
9 #include <pthread.h>
10
11 int pthread_equal(pthread_t t1, pthread_t t2);
12
13 Compile and link with -pthread.
14
16 The pthread_equal() function compares two thread identifiers.
17
19 If the two thread IDs are equal, pthread_equal() returns a nonzero
20 value; otherwise, it returns 0.
21
23 This function always succeeds.
24
26 For an explanation of the terms used in this section, see at‐
27 tributes(7).
28
29 ┌────────────────────────────────────────────┬───────────────┬─────────┐
30 │Interface │ Attribute │ Value │
31 ├────────────────────────────────────────────┼───────────────┼─────────┤
32 │pthread_equal() │ Thread safety │ MT-Safe │
33 └────────────────────────────────────────────┴───────────────┴─────────┘
34
36 POSIX.1-2001, POSIX.1-2008.
37
39 The pthread_equal() function is necessary because thread IDs should be
40 considered opaque: there is no portable way for applications to direct‐
41 ly compare two pthread_t values.
42
44 pthread_create(3), pthread_self(3), pthreads(7)
45
47 This page is part of release 5.13 of the Linux man-pages project. A
48 description of the project, information about reporting bugs, and the
49 latest version of this page, can be found at
50 https://www.kernel.org/doc/man-pages/.
51
52
53
54Linux 2021-03-22 PTHREAD_EQUAL(3)