[PATCH wayland v4] client: Introduce proxy wrappers

Bill Spitzak spitzak at gmail.com
Fri Apr 29 18:38:23 UTC 2016


On Fri, Apr 29, 2016 at 5:59 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:

>
> > +     pthread_mutex_lock(&wrapped_proxy->display->mutex);
> > +
> > +     wrapper->object.interface = wrapped_proxy->object.interface;
> > +     wrapper->object.id = wrapped_proxy->object.id;
> > +     wrapper->version = wrapped_proxy->version;
> > +     wrapper->display = wrapped_proxy->display;
> > +     wrapper->queue = wrapped_proxy->queue;
> > +     wrapper->flags = WL_PROXY_FLAG_WRAPPER;
> > +     wrapper->refcount = 1;
> > +
> > +     pthread_mutex_unlock(&wrapped_proxy->display->mutex);
> > +
> > +     return wrapper;
> > +}
>
> I didn't want to postpone the landing of this any longer, but I still
> wonder if we really need that locking at all.
>

That locking is certainly not necessary.

If another thread could change the wrapped_proxy, it could easily change it
after the lock is dropped and this function returns, thus making the
proxy_wrapper incorrect anyway. So this lock is not preventing any problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160429/37fdfe33/attachment.html>


More information about the wayland-devel mailing list