mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 13:00:15 +02:00
ARM64EC: Use correct context flags in ThreadTerm
This commit is contained in:
1 parent
b1e54d803b
commit
517a1836ee
1 file changed
+2
-1
@@ -1018,7 +1018,7 @@ NTSTATUS ThreadTerm(HANDLE Thread, LONG ExitCode) {
|
||||
return STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
auto ThreadDup = FEX::Windows::DupHandle(Thread, THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME);
|
||||
auto ThreadDup = FEX::Windows::DupHandle(Thread, THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME | THREAD_GET_CONTEXT);
|
||||
|
||||
THREAD_BASIC_INFORMATION Info;
|
||||
if (auto Err = NtQueryInformationThread(*ThreadDup, ThreadBasicInformation, &Info, sizeof(Info), nullptr); Err) {
|
||||
@@ -1032,6 +1032,7 @@ NTSTATUS ThreadTerm(HANDLE Thread, LONG ExitCode) {
|
||||
// If we are suspending a thread that isn't ourselves, try to suspend it first so we know internal JIT locks aren't being held.
|
||||
NtSuspendThread(*ThreadDup, NULL);
|
||||
// This will wait for the thread to be suspended
|
||||
TmpContext.ContextFlags = CONTEXT_CONTROL;
|
||||
NtGetContextThread(*ThreadDup, &TmpContext);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user