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
27 attributes(7).
28
29 ┌────────────────┬───────────────┬─────────┐
30 │Interface │ Attribute │ Value │
31 ├────────────────┼───────────────┼─────────┤
32 │pthread_equal() │ Thread safety │ MT-Safe │
33 └────────────────┴───────────────┴─────────┘
35 POSIX.1-2001, POSIX.1-2008.
36
38 The pthread_equal() function is necessary because thread IDs should be
39 considered opaque: there is no portable way for applications to
40 directly compare two pthread_t values.
41
43 pthread_create(3), pthread_self(3), pthreads(7)
44
46 This page is part of release 5.04 of the Linux man-pages project. A
47 description of the project, information about reporting bugs, and the
48 latest version of this page, can be found at
49 https://www.kernel.org/doc/man-pages/.
50
51
52
53Linux 2015-08-08 PTHREAD_EQUAL(3)