FEXCore: Changes ParentThread ownership from the CTX to the frontend, take 2

Similar to #3284 but works around some of the bugs that one introduced.

This is the minimal amount of changes to move the ownership from FEXCore
to the frontend. Since the frontends don't yet have a full thread state
tracking, there is an opaque pointer that needs to be managed.

In the followup commits this will be changed to have the syscall handler
to be the thread object manager.
This commit is contained in:
Ryan Houdek committed 2023-12-18 14:54:07 -08:00
1 parent 68d6cf5f14
commit aa2e8704bc
12 files changed
+93 -56

No files matched your search

+2 -2
View File
@@ -517,7 +517,7 @@ void BTCpuProcessInit() {
CTX = FEXCore::Context::Context::CreateNewContext();
CTX->SetSignalDelegator(SignalDelegator.get());
CTX->SetSyscallHandler(SyscallHandler.get());
CTX->InitCore(0, 0);
CTX->InitCore();
CpuInfo.ProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL;
@@ -554,7 +554,7 @@ void BTCpuProcessInit() {
}
NTSTATUS BTCpuThreadInit() {
GetTLS().ThreadState() = CTX->CreateThread(0, 0);
GetTLS().ThreadState() = CTX->CreateThread(0, 0, FEXCore::Context::Context::ManagedBy::FRONTEND);
std::scoped_lock Lock(ThreadSuspendLock);
InitializedWOWThreads.emplace(GetCurrentThreadId());