# thrd_equal

> C++ Atlas: `cppatlas.com/w/c/thread/thrd_equal` | Source: https://en.cppreference.com/w/c/thread/thrd_equal | Domain: Concurrency support | Standards: C11

Checks whether lhs and rhs refer to the same thread.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <threads.h>
int thrd_equal( thrd_t lhs, thrd_t rhs ); // (since C11)
```

Checks whether `lhs` and `rhs` refer to the same thread.

### Parameters

- `lhs, rhs` - threads to compare

### Return value

Non-zero value if `lhs` and `rhs` refer to the same value, `​0​` otherwise.

### References

- C17 standard (ISO/IEC 9899:2018):

  - 7.26.5.4 The thrd_equal function (p: 280)

- C11 standard (ISO/IEC 9899:2011):

  - 7.26.5.4 The thrd_equal function (p: 384)

### See also

- [C++ documentation for `operator_cmp`](https://en.cppreference.com/w/cpp/thread/thread/id/operator_cmp)

---
Attribution: content from https://en.cppreference.com/w/c/thread/thrd_equal (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.