Uh oh!
There was an error while loading. Please reload this page.
Implement ControlledExecution API - #71661
Conversation
ghost
commented
Jul 5, 2022
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
Jul 5, 2022
Looks good in general. I think the remaining open issues are:
|
Uh oh!
There was an error while loading. Please reload this page.
AntonLapounov
commented
Jul 6, 2022
The failure in "Libraries Test Run checked coreclr Linux_musl arm64 Release" looks similar to this one: #66413 (comment). |
Uh oh!
There was an error while loading. Please reload this page.
2be3526 to
f93ded4CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AntonLapounov
commented
Jul 26, 2022
The failures in the last run are unrelated: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AntonLapounov
commented
Jul 28, 2022
Thank you for very valuable feedback! |
AntonLapounov
commented
Aug 6, 2022
#73399 enabled this API on non-Windows operating systems. |
Implementation for API proposal #69622:
The
Runmethod runs the specified action and allows to abort it asynchronously using the provided cancellation token. When cancellation is requested, the registeredExecution.Abortcallback calls theThread::UserAbortruntime function, which is currently employed by the debugger to abort function evaluation. That function sets theTS_AbortRequestedflag on the thread to abort, which causes the runtime to throw an asynchronousThreadAbortException. This exception may be caught by the code being executed; however, it is automatically rethrown at the end ofcatchblocks. However, the code may catch it and throw an exception of a different type.The
Runmethod resets theTS_AbortRequestedflag on the current thread if execution of the action has been aborted, which stops rethrowing the exception. It also catches theThreadAbortExceptionand normalizes it to anOperationCancelledException.Recursive
ControlledExecution.Runcalls are not supported at present — we can support them if there is a valid scenario.An example of using this API:
FYI: @mangod9@janvorli