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

Marek Chalupa mchqwerty at gmail.com
Mon Mar 23 03:00:15 PDT 2015


Destroyed seems confusing to me too, since the resource is not really
destroyed. What about inert or unalive ?

On Thu, Mar 19, 2015 at 2:34 PM, Bill Spitzak <spitzak at gmail.com> wrote:

> 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.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150323/014c01ea/attachment.html>


More information about the wayland-devel mailing list