qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] iothread: create the gcontext onconditional


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH 2/4] iothread: create the gcontext onconditionally
Date: Fri, 22 Feb 2019 14:47:57 +0800
User-agent: Mutt/1.10.1 (2018-07-13)

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 <address@hidden>

Thanks for the quick review,

-- 
Peter Xu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]