View Issue Details

IDProjectCategoryView StatusLast Update
00019651003.1(2024)/Issue8System Interfacespublic2026-01-06 10:02
Reporterdannyniu Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status NewResolutionOpen 
NameDannyNiu/NJF
Organization
User Reference
Section<pthread.h> `pthread_equal`
Page Number239, 1722
Line Number11576, 57189-57227
Interp Status
Final Accepted Text
Summary0001965: Why isn't pthread_equal async-signal safe?
DescriptionCurrently there are 4 pthread_* functions that're async-signal-safe, including pthread_self.

IMHO, there's no reason to not make pthread_equal safe, unless during some thread control operation, some function would modify the internal data structure if pthread_t is not a scalar.

Additionally, unless some implementation _does_ alter pthread_t handle, I think it's perfectly fine to require that the arguments be const-qualified, or that pthread_t be a pointer to a const-qualified data structure.
Desired ActionClarify whether and why pthread_equals isn't an async-signal-safe function.
TagsNo tags attached.

Activities

geoffclare

2026-01-06 10:02

manager   bugnote:0007352

In POSIX.1-1996 and SUSv3/POSIX.1-2001 there were no pthread_* functions in the async-signal-safe list. The reason that four of them have since been added is to resolve issues. For example, pthread_self() and pthread_kill() are required to be async-signal-safe because raise() is required to be both async-signal-safe and equivalent to pthread_kill(pthread_self(), sig).

So the reason pthread_equal() is not required to be safe is because there is no known issue that would be resolved by requiring it to be safe.

Issue History

Date Modified Username Field Change
2025-12-21 06:49 dannyniu New Issue
2026-01-06 10:02 geoffclare Note Added: 0007352