---
name: "pthread_equal"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pthread_equal"
---

# pthread\_equal(3)

compare thread IDs

## NAME

**pthread\_equal** – compare thread IDs

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## 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”).
