Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ThreadAbort with CET enabled via the QueueUserAPC2 (#70803)
This change makes ThreadAbort work when CET is enabled. Instead of thread redirection, it uses the new user mode APC mechanism to get a thread to a handler and then throws the ThreadAbortException from there if the thread was interrupted at a safe location. I have verified it works using mdbg tests and also by manual testing in the Visual Studio 2022 using a test app that creates an instance of classes with properties containing infinite loop, wait on a lock, wait on a handle, infinite loop inside of a lock and infinite loop in finally. For the testing, I've enabled this separately from the CET so that the missing support for CET in the debugger code doesn't cause troubles. So we could enable this without CET enabled too, but I'd prefer doing that separately.
- Loading branch information