WOW64: Mark the CPU area context as dirty initially

After thread creation, the WOW64 CPU area context needs to be flushed
into the FEX state before entering the JIT. Wine explicitly calls
BTCpuSetContext to trigger this but Windows doesn't.
This commit is contained in:
Billy Laws committed 2024-08-09 11:57:09 +00:00
1 parent 4c0e6d5779
commit 26a8a2717c
1 file changed
+1
+1
View File
@@ -468,6 +468,7 @@ void BTCpuThreadInit() {
FEX::Windows::InitCRTThread();
auto* Thread = CTX->CreateThread(0, 0);
GetTLS().ThreadState() = Thread;
GetTLS().ControlWord().fetch_or(ControlBits::WOW_CPU_AREA_DIRTY, std::memory_order::relaxed);
std::scoped_lock Lock(ThreadCreationMutex);
Threads.emplace(GetCurrentThreadId(), Thread);