This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Use finally in EC.R rather than catch+throw #11095
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows the opportunity to benefit from Finally Cloning by the Jit.
I didn't quite understand the comment and whether there was some mechanism I wasn't picking up on (e.g. a first chance exception "filter") but not sure what it refers to.
It was from the original open sourcing, so maybe something was different at that time. Exception from the undo for example? (only seems to be a catch -> Environment.FailFast in the undo path)
I checked Reference Source for 4.7 to see if there was more clarity around this comment and it uses finally for undoing the ec in ExecutionContext.RunInternal and not catch+throw.
/cc @jkotas @AndyAyersMS @stephentoub