Make circular type forwarder protection thread-safe #978
Loading…
Reference in a new issue
No description provided.
Delete branch "Unity-Technologies/circular-type-thread-safe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR https://github.com/jbevain/cecil/pull/806 added protection against circular type forwarders using an instance-level
bool reentrancyGuardvariable. This created race conditions when multiple threads resolved the sameExportedType.This PR replaces the bool with a
[ThreadStatic] static int reentrancyDepthcounter, allowing forwarding up toconst int MaxForwardingDepth = 16depth, which is thread-safe and supports legitimate forwarding chains.I added a test (
TypeForwarderMultiLevel) that resolves a simple forwarding chain.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.