1pthread_equal(3) Library Functions Manual pthread_equal(3)
2
3
4
6 pthread_equal - compare thread IDs
7
9 POSIX threads library (libpthread, -lpthread)
10
12 #include <pthread.h>
13
14 int pthread_equal(pthread_t t1, pthread_t t2);
15
17 The pthread_equal() function compares two thread identifiers.
18
20 If the two thread IDs are equal, pthread_equal() returns a nonzero
21 value; otherwise, it returns 0.
22
24 This function always succeeds.
25
27 For an explanation of the terms used in this section, see at‐
28 tributes(7).
29
30 ┌────────────────────────────────────────────┬───────────────┬─────────┐
31 │Interface │ Attribute │ Value │
32 ├────────────────────────────────────────────┼───────────────┼─────────┤
33 │pthread_equal() │ Thread safety │ MT-Safe │
34 └────────────────────────────────────────────┴───────────────┴─────────┘
35
37 POSIX.1-2008.
38
40 POSIX.1-2001.
41
43 The pthread_equal() function is necessary because thread IDs should be
44 considered opaque: there is no portable way for applications to
45 directly compare two pthread_t values.
46
48 pthread_create(3), pthread_self(3), pthreads(7)
49
50
51
52Linux man-pages 6.05 2023-07-20 pthread_equal(3)