---
name: "pthread_equal"
section: "3"
platform: "macos"
package: "libpthread"
version: "539.100.4"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pthread_equal"
---

# pthread\_equal(3)

compare thread IDs

## NAME

**pthread\_equal** – compare thread IDs

## SYNOPSIS

**#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 will return non-zero if the thread IDs *t1* and *t2* correspond to the same thread, otherwise it will return zero.

## ERRORS

None.

## SEE ALSO

[pthread\_create(3)](/pthread_create/3.md), [pthread\_exit(3)](/pthread_exit/3.md)

## STANDARDS

The **pthread\_equal**() function conforms to ISO/IEC 9945-1:1996 (“POSIX.1”).
