Hi Richard

On Fri, Sep 30, 2022 at 6:10 PM Richard Henderson
<richard.hender...@linaro.org> wrote:
>
> On 9/30/22 07:03, marcandre.lur...@redhat.com wrote:
> > +static bool
> > +set_thread_description(HANDLE h, const char *name)
> > +{
> > +  HRESULT hr;
> > +  g_autofree wchar_t *namew = NULL;
> > +
> > +  if (!load_set_thread_description()) {
> > +      return false;
> > +  }
>
> I don't understand why you're retaining this.
> What is your logic?

The function should be MT-safe that way (load_set_thread_description
should be too). But since we changed the way we invoke it, by relying
on non-protected "name_threads" and we set it to false when the
function cannot be loaded, we can just drop this. We can also drop
g_once usage from load_set_thread_description. There is no explicit
guarantee on when qemu_thread_naming() is called, and I am pretty sure
qemu_thread_create() is called from different threads too.


Reply via email to