Hi

On Thu, Sep 29, 2022 at 9:53 PM Richard Henderson <
richard.hender...@linaro.org> wrote:

> On 9/29/22 06:41, marcandre.lur...@redhat.com wrote:
> >   void qemu_thread_naming(bool enable)
> >   {
> >       /* But note we don't actually name them on Windows yet */
> >       name_threads = enable;
> >
> > -    fprintf(stderr, "qemu: thread naming not supported on this host\n");
> > +    if (enable && !load_set_thread_description()) {
> > +        fprintf(stderr, "qemu: thread naming not supported on this
> host\n");
> > +    }
> >   }
>
> Comment is out of date, and I think it would be better to *not* set
> name_threads if not
> supported, rather than...
>

Comment removed.


>
>
> > +static bool
> > +set_thread_description(HANDLE h, const char *name)
> > +{
> > +  HRESULT hr;
> > +  g_autofree wchar_t *namew = NULL;
> > +
> > +  if (!load_set_thread_description() || !name) {
> > +      return false;
> > +  }
>
> ... have to re-query load_set_thread_description later.
>

The load_set_thread_description() function is actually a "one-time"
function, it doesn't re-load.


>
> Also, unused return value; might as well be void.
>

Right, maybe it should warn if it failed to set the name?


-- 
Marc-André Lureau

Reply via email to