[RFC wayland 1/2] server: implement intact resources

Bill Spitzak spitzak at gmail.com
Thu Mar 19 11:34:09 PDT 2015


I think the name "intact" is really confusing. Can it be instead called 
"destroyed"?

On 03/19/2015 01:11 AM, Marek Chalupa wrote:
> When server looses some capability (like pointer or keyboard),
> it takes some time to get this information to clients.
> When client sends request with new_id argument to the object
> that has been just destroyed on server-side (client
> does not know about it yet), we still have to create the resource.
> If we wouldn't do it then the client will get invalid id error once it
> tries to use the new object. But if we create it, then we have to
> take care that all the requests but destructor are ignored,
> because we do not have the server-side object anymore.
> (eventually, client will destroy the resource, because
> it will get the information about server-side object destruction)
>
> This patch solves this ugly race by adding wl_resource_set_intact()
> function that marks the resource as intact. When resource is intact
> it ignores all requests and events but destructors. The trick is in
> adding flag into the request's siganture that says: "hey! I'm
> destructor". Server then can skip non-destructor actions on intact
> resource.
>
> Programmer then can mark newly created resource as intact when
> this race come up instead of defining new implementation of
> resource just for this rare case.



More information about the wayland-devel mailing list