pthread_equal(3C) Standard C Library Functions pthread_equal(3C)NAME
pthread_equal - compare thread IDs
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <pthread.h>
int pthread_equal(pthread_t t1, pthread_t t2);
DESCRIPTION
The pthread_equal() function compares the thread IDs t1 and t2.
RETURN VALUES
The pthread_equal() function returns a non-zero value if t1 and t2 are equal. Otherwise, 0 is returned.
If t1 or t2 is an invalid thread ID, the behavior is undefined.
ERRORS
No errors are defined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO pthread_create(3C), pthread_self(3C), attributes(5), standards(5)NOTES
Solaris thread IDs do not require an equivalent function because the thread_t structure is an unsigned int.
SunOS 5.11 23 Mar 2005 pthread_equal(3C)
Check Out this Related Man Page
PTHREAD_EQUAL(3) Linux Programmer's Manual PTHREAD_EQUAL(3)NAME
pthread_equal - compare thread IDs
SYNOPSIS
#include <pthread.h>
int pthread_equal(pthread_t t1, pthread_t t2);
Compile and link with -pthread.
DESCRIPTION
The pthread_equal() function compares two thread identifiers.
RETURN VALUE
If the two thread IDs are equal, pthread_equal() returns a nonzero value; otherwise, it returns 0.
ERRORS
This function always succeeds.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+----------------+---------------+---------+
|Interface | Attribute | Value |
+----------------+---------------+---------+
|pthread_equal() | Thread safety | MT-Safe |
+----------------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
NOTES
The pthread_equal() function is necessary because thread IDs should be considered opaque: there is no portable way for applications to
directly compare two pthread_t values.
SEE ALSO pthread_create(3), pthread_self(3), pthreads(7)COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2015-08-08 PTHREAD_EQUAL(3)
I read somewhere that I should use -pthread instead of -lpthread as compiler/linker flag, or define _REENTRANT. Is this incorrect to use only -lpthread? (I use gcc) (5 Replies)
The prototype for pthread_create function is like this:-
int pthread_create(pthread_t *thread,pthread_attr_t *attr,void *(*start routine),void *arg);
Q.1 .Why the return type of the start_routine must be void*??
Q.2. Why should we pass arg by converting into void * only ??
Thank You (3 Replies)
This question might be silly but its confusing me a bit:
What is the difference between handle to the thread HANDLE and thread identifier pthread_t?
---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ----------
Sorry I saw details and HANDLE is in windows and... (0 Replies)
I have two files File1, File2. File1 has whole list of IDs and File2 has a limited IDs. i need to compare these two files and take the IDs which are not present in File2 but present in File1. can someone tell me a command. (3 Replies)