1PTHREAD_EQUAL(3)           Linux Programmer's Manual          PTHREAD_EQUAL(3)
2
3
4

NAME

6       pthread_equal - compare thread IDs
7

SYNOPSIS

9       #include <pthread.h>
10
11       int pthread_equal(pthread_t t1, pthread_t t2);
12
13       Compile and link with -pthread.
14

DESCRIPTION

16       The pthread_equal() function compares two thread identifiers.
17

RETURN VALUE

19       If  the  two  thread  IDs  are equal, pthread_equal() returns a nonzero
20       value; otherwise, it returns 0.
21

ERRORS

23       This function always succeeds.
24

ATTRIBUTES

26       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
27       tributes(7).
28
29       ┌────────────────────────────────────────────┬───────────────┬─────────┐
30Interface                                   Attribute     Value   
31       ├────────────────────────────────────────────┼───────────────┼─────────┤
32pthread_equal()                             │ Thread safety │ MT-Safe │
33       └────────────────────────────────────────────┴───────────────┴─────────┘
34

CONFORMING TO

36       POSIX.1-2001, POSIX.1-2008.
37

NOTES

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

SEE ALSO

44       pthread_create(3), pthread_self(3), pthreads(7)
45

COLOPHON

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)
Impressum