On Fri, Feb 22, 2019 at 07:29:09AM +0100, Marc-André Lureau wrote:

[...]

> > diff --git a/iothread.c b/iothread.c
> > index 6e297e9ef1..6fa87876e0 100644
> > --- a/iothread.c
> > +++ b/iothread.c
> > @@ -65,7 +65,7 @@ static void *iothread_run(void *opaque)
> >           * We must check the running state again in case it was
> >           * changed in previous aio_poll()
> >           */
> > -        if (iothread->running && atomic_read(&iothread->worker_context)) {
> > +        if (iothread->running && atomic_read(&iothread->run_gcontext)) {
> >              GMainLoop *loop;
> >
> >              g_main_context_push_thread_default(iothread->worker_context);
> > @@ -114,6 +114,8 @@ static void iothread_instance_init(Object *obj)
> >      iothread->poll_max_ns = IOTHREAD_POLL_MAX_NS_DEFAULT;
> >      iothread->thread_id = -1;
> >      qemu_sem_init(&iothread->init_done_sem, 0);
> > +    /* By default, we don't run gcontext */
> > +    atomic_set(&iothread->run_gcontext, 0);
> 
> I think that initialization isn't really necessary, your call.

True; it's more a hint for readers who suddenly jumped into
iothread_run.  Thanks for being kind, since I would prefer to have it
for now. ;)

[...]

> looks good otherwise,
> Reviewed-by: Marc-André Lureau <marcandre.lur...@redhat.com>

Thanks for the quick review,

-- 
Peter Xu

Reply via email to