<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 5:59 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br></div></div><span class="">
> +     pthread_mutex_lock(&wrapped_proxy->display->mutex);<br>
> +<br>
> +     wrapper->object.interface = wrapped_proxy->object.interface;<br>
> +     wrapper-><a href="http://object.id" rel="noreferrer" target="_blank">object.id</a> = wrapped_proxy-><a href="http://object.id" rel="noreferrer" target="_blank">object.id</a>;<br>
> +     wrapper->version = wrapped_proxy->version;<br>
> +     wrapper->display = wrapped_proxy->display;<br>
> +     wrapper->queue = wrapped_proxy->queue;<br>
> +     wrapper->flags = WL_PROXY_FLAG_WRAPPER;<br>
> +     wrapper->refcount = 1;<br>
> +<br>
> +     pthread_mutex_unlock(&wrapped_proxy->display->mutex);<br>
> +<br>
> +     return wrapper;<br>
> +}<br>
<br>
</span>I didn't want to postpone the landing of this any longer, but I still<br>
wonder if we really need that locking at all.<br></blockquote><div><br></div><div>That locking is certainly not necessary.</div><div><br></div><div>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.</div><div><br></div></div></div></div>