Re: [spice-gtk] Fix IN_MAIN_CONTEXT when using coroutine=gthread

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

 




----- Original Message -----
> On Fri, Nov 15, 2013 at 10:45:42AM -0500, Marc-André Lureau wrote:
> > 
> > 
> > ----- Original Message -----
> > > On Fri, Nov 15, 2013 at 04:05:55PM +0100, Christophe Fergeau wrote:
> > > > However, this is an
> > > > implementation detail of the ucontext coroutine implementation, in the
> > > > gthread implementation, coroutine_self()->caller will be non-NULL even
> > > > in
> > > > the main context.
> > > NB: Maybe the actual bug is that coroutine_self()->caller in non-NULL for
> > > the main context in the gthread backend, but I'm not familiar enough with
> > > the coroutine code to know that.
> > 
> > I don't see when coroutine_self()->caller could be non-null in main
> > coroutine, even with gthread backend.
> 
> This is coroutine_swap() from coroutine_gthread.c
> void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
> {
>         from->runnable = FALSE;
> 
> from is non-NULL here
> 
> 
>         to->runnable = TRUE;
> 
> 'to' becomes the coroutine with 'runnable' set to TRUE
> 
> 
>         to->data = arg;
>         to->caller = from;
> 
> we set to->caller to something non-NULL

Oh ok, even if "to" is the main coroutine, that make sense. It does the same with other coroutines, I wonder why we didn't hit that before when the macro was added.

ack for your patch, comparing to the static "leader" seems the correct thing to do.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]