Re: [PATCH] async_die_is_recursing: fix use of pthread_getspecific for Fedora
- From
Jeff King <peff@peff.net>
- Date
- Nov 4, 2021, 05:56 UTC
- Message-ID
- <YYN1+tonXZgL9dDa@coredump.intra.peff.net>
- In-Reply-To
- <CAPUEspjnu8ySiM5damzCoPWhLv+azZFxsZun5Lztjwd-fDopaw@mail.gmail.com>
On Wed, Nov 03, 2021 at 08:20:56PM -0700, Carlo Arenas wrote:
Show 8 quoted lines
> Agree it is OK as a minimal fix, but also AFAIK nothing is really > stuck either, so something as simple as : > > s/&ret/&async_die_counter/g > > Would make it as minimal, and less likely to trigger something else in > the future (I am surprised nothing warns about local variables being > used out of scope).
It's in scope when we call the function. The potential for bugs only happens because we know pthread_setspecific() is going to hold on to it. So the compiler complaining would imply that it knows the semantics of the pthread function.
-Peff