<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 20, 2019 at 1:32 AM Derek Lesho <<a href="mailto:dlesho@codeweavers.com">dlesho@codeweavers.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Also, in your patch, I noticed that you intentionally unlock before <br>
performing the copy or overwrite.  This puzzles me, if one thread waits <br>
on the global mutex for access to a descriptor's view to dereference, <br>
and we unlock the mutex for them when the view is NULL, they may crash <br>
when trying to decrement the reference of the NULL view.<br></blockquote><div><br></div><div>Yes, it's missing a null check after locking the mutex. If it's null after locking then the function can return because it means another thread has destroyed the descriptor. I think the only remaining problem is the old one of a single mutex being used for all descriptors. Maybe performance can be improved.<br></div></div></div>