[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
[Qemu-devel] [PATCH 3/4] iothread: create main loop unconditionally, Peter Xu, 2019/02/21
[Qemu-devel] [PATCH 2/4] iothread: create the gcontext onconditionally, Peter Xu, 2019/02/21
[Qemu-devel] [PATCH 4/4] iothread: push gcontext earlier in the thread_fn, Peter Xu, 2019/02/21
Re: [Qemu-devel] [PATCH 0/4] iothread: create gcontext unconditionally, Paolo Bonzini, 2019/02/22