qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the t


From: Peter Xu
Subject: Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn
Date: Fri, 8 Mar 2019 11:05:23 +0800
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, Mar 07, 2019 at 02:40:39PM +0000, Stefan Hajnoczi wrote:
> On Wed, Mar 06, 2019 at 07:55:31PM +0800, Peter Xu wrote:
> > +    /*
> > +     * We should do this as soon as we enter the thread, because the
> > +     * function will silently fail if it fails to acquire the
> > +     * gcontext.
> > +     */
> > +    g_main_context_push_thread_default(iothread->worker_context);
> 
> I have a hard time understanding this comment.  The mention of how it
> fails makes me think "we'll never find out about failures anyway, so how
> does it help to call this early?".
> 
> I suggest sticking to the point that this function must always be called
> first:
> 
>   /*
>    * g_main_context_push_thread_default() must be called before anything
>    * in this new thread uses glib.
>    */
> 
> Now people will think before moving this function call.

Sorry to be confusing; this looks good to me.  Please let me know if
you want me to repost this patch alone or the patchset with the change.

Thanks,

-- 
Peter Xu



reply via email to

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