[Spice-devel] [spice-gtk 3/5] session: don't track open_host_idle source id

Marc-André Lureau marcandre.lureau at gmail.com
Tue Feb 4 06:22:47 PST 2014


On Tue, Feb 4, 2014 at 2:48 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> On Wed, Jan 22, 2014 at 07:26:49PM +0100, Marc-André Lureau wrote:
>> From: Marc-André Lureau <marcandre.lureau at redhat.com>
>>
>> In all cases, when the coroutine is resumed, the idle source has been
>> removed.
>
> Are you sure about this? I see some coroutine_yieldto() in error cases in
> open_host_idle_cb (but I always get the coroutine code wrong).
>

but the source is removed there anyway

> Also, the commit which added this code was saying that we could get back to
> the coroutine before the idle runs:
>
> commit 5ed7f06e7c7a9fa9c6b0411debd43793335068ec
> Author: Marc-André Lureau <marcandre.lureau at redhat.com>
> Date:   Sun Dec 23 20:56:09 2012 +0100
>
>     Clean-up idle handler when leaving the open_host_idle()
>
>     An explicit yield back to the channel coroutine when the idle function
>     is still pending will leave it in the background, referencing objects
>     that may no longer exist. Make sure we remove it when
>     channel_open_host() is resumed.
>
> Is this no longer valid?

Yes, I think this I was over-zealous. You shouldn't resume coroutines
at will, depending on their state it might be a wrong thing to do. If
there is a pending resume / return in an idle source, then it's wrong
to resume outside.




-- 
Marc-André Lureau


More information about the Spice-devel mailing list