[Spice-devel] [PATCH 2/3] server: really wait for a surface to be destroyed, when calling destroy_surface_wait

Alexander Larsson alexl at redhat.com
Thu Aug 26 08:16:23 PDT 2010


On Thu, 2010-08-26 at 17:28 +0300, Yonit Halperin wrote:
> On 08/26/2010 05:25 PM, Alexander Larsson wrote:
> red_push doesn't send one item at a time, but rather pushes till it 
> blocks (due to socket block or missing acks). So if the item is still in 
> the pipe, it means that channel->send_data.blocked
> >> +        red_receive(channel);
> >> +        red_send_data(channel, NULL);
> >> +        red_push(channel->worker);
> >> +    }
> >
> > Also, I'm generally worried a bit about the red_receive calls. While
> > waiting for sending the stuff in the pipe, handling the
> > destroy_surface_wait we may handle an incoming message from the client
> > which sort of reenters the existing call stack. Isn't there a risk that
> > such reentrancy causes problems? like deadlocks or weird crashes?
> >
> >
> First, we must call red_receive, since if we are missing acks, we won't 
> get out of the blocking mode. Second, I don't think that any message 
> from the client can cause re-entering to this call stack.

Yeah, i don't know of any existing codepath where this is a problem. I
just generally fear reentrancy. Its bitten me in the ass way to many
times before. Otoh, its not like we don't do this already in other ways.

So, ack from me.




More information about the Spice-devel mailing list