[PATCH v4 2/2] vkd3d: Don't allow concurrent writes to descriptors.

Conor McCarthy conor.mccarthy.444 at gmail.com
Thu Sep 19 11:12:03 CDT 2019


On Fri, Sep 20, 2019 at 1:32 AM Derek Lesho <dlesho at codeweavers.com> wrote:

> Also, in your patch, I noticed that you intentionally unlock before
> performing the copy or overwrite.  This puzzles me, if one thread waits
> on the global mutex for access to a descriptor's view to dereference,
> and we unlock the mutex for them when the view is NULL, they may crash
> when trying to decrement the reference of the NULL view.
>

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190920/8f5d7cbc/attachment.htm>


More information about the wine-devel mailing list