@zfigura Could you elaborate on what the problem was? Since we now have a (more or less) reliably reproducible case, do you think it's okay to proceed with this MR (or !4811) even if it's not a complete solution?
From the conversation, I simultaneously got the impression that we don't care about NtTerminateThread() breaking things, but also that if we're going to solve this problem we need to solve it everywhere, including avoiding deadlocks or corruption in win32u. At the same time it seemed that we need a generic solution for addressing all of these deadlocks, rather than addressing specific deadlocks using specific mechanisms. I am not nearly smart enough to satisfy both of these constraints; they seem impossible to me. I haven't the faintest idea how you can possibly avoid any problems in reentrant syscalls, without dealing with them on a case by case basis.