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

Conor McCarthy conor.mccarthy.444 at gmail.com
Thu Sep 19 09:31:27 CDT 2019


I think it's risky to store the lock in the vkd3d_view, because if the
current thread hasn't already inc'd the ref count, the view could be
deallocated at any time.

The core problem is that while ref counting is fine for concurrent
management of object lifetime, it's not a safe way to acquire a reference
to an object to which we have no reference. You could have just incremented
the ref count of a deallocated object! So we need locks to protect the
acquisition of a reference. I've attached a patch which does this and is
sufficient to get the game working. It uses the device mutex so is not
optimal, but it's designed to spend the minimum amount of time locked. See
if you can make a faster spinlock version.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190920/f1f6754c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-vkd3d-Acquire-references-to-descriptor-view-objects-.patch
Type: text/x-patch
Size: 3327 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190920/f1f6754c/attachment.bin>


More information about the wine-devel mailing list