Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined
- Date: Tue, 21 May 2019 17:27:44 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined
On Tue, May 21, 2019 at 12:33:58PM -0700, Jeff Hostetler via GitGitGadget wrote:
> As Duy suggested, pthread_getspecific() just returns NULL when NO_PTHREADS
> is defined. And pthread_setspecific() silently does not nothing. So this
> problem was hidden from view.
> I have to wonder if we should update pthread_*specific() to call BUG() when
> NO_PTHREADS is defined as a way to catch unguarded usages easier or make
> this issue more clear.
I think it should actually store the data asked for by the caller, as if
we were the single thread running. We discussed this as the time of
refactoring NO_PTHREADS, but there was only one caller that would have
benefited. Now there are two. ;)
Discussion in the subthread of this patch: