[PATCH 5/5] nptl: Rename __wrefs to __flags because its meaning has changed
Torvald Riegel
triegel@redhat.com
Mon Jan 18 23:47:19 GMT 2021
On Sat, 2021-01-16 at 15:49 -0500, Malte Skarupke wrote:
> When I remove the increment/decrement of wrefs in pthread_cond_wait,
> it no longer really had the meaning of representing the number of
> waiters. So the name "wrefs" is no longer accurate. It is still used
> as a reference count in an edge case, in the interaction between
> pthread_cancel and pthread_cond_destroy, but that edge case shouldn't
> be what this variable is named after.
I don't think that this change is good. Cancellation is not
necessarily an "edge case" because it will happen whenever timeouts are
involved. More importantly, the wake-up flag is an integral part of
the refcount. The other flags in there are just in there because
available space was scarce (ABI...). So if you want to rename it, I'd
make it "cancellation_refs" or "crefs" or something like that, not just
"flags".
More information about the Libc-alpha
mailing list