Thread: Release the ARM Interface on exitting.
This commit is contained in:
parent
1567824d2d
commit
5974e3ea33
@ -724,7 +724,7 @@ void Scheduler::SwitchContext() {
|
|||||||
previous_thread->SetContinuousOnSVC(false);
|
previous_thread->SetContinuousOnSVC(false);
|
||||||
previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
||||||
previous_thread->SetIsRunning(false);
|
previous_thread->SetIsRunning(false);
|
||||||
if (!previous_thread->IsHLEThread()) {
|
if (!previous_thread->IsHLEThread() && !previous_thread->HasExited()) {
|
||||||
Core::ARM_Interface& cpu_core = previous_thread->ArmInterface();
|
Core::ARM_Interface& cpu_core = previous_thread->ArmInterface();
|
||||||
cpu_core.SaveContext(previous_thread->GetContext32());
|
cpu_core.SaveContext(previous_thread->GetContext32());
|
||||||
cpu_core.SaveContext(previous_thread->GetContext64());
|
cpu_core.SaveContext(previous_thread->GetContext64());
|
||||||
|
@ -69,6 +69,8 @@ void Thread::Stop() {
|
|||||||
// Mark the TLS slot in the thread's page as free.
|
// Mark the TLS slot in the thread's page as free.
|
||||||
owner_process->FreeTLSRegion(tls_address);
|
owner_process->FreeTLSRegion(tls_address);
|
||||||
}
|
}
|
||||||
|
arm_interface.reset();
|
||||||
|
has_exited = true;
|
||||||
}
|
}
|
||||||
global_handle = 0;
|
global_handle = 0;
|
||||||
}
|
}
|
||||||
|
@ -610,6 +610,10 @@ public:
|
|||||||
is_phantom_mode = phantom;
|
is_phantom_mode = phantom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasExited() const {
|
||||||
|
return has_exited;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GlobalScheduler;
|
friend class GlobalScheduler;
|
||||||
friend class Scheduler;
|
friend class Scheduler;
|
||||||
@ -714,6 +718,7 @@ private:
|
|||||||
|
|
||||||
bool will_be_terminated = false;
|
bool will_be_terminated = false;
|
||||||
bool is_phantom_mode = false;
|
bool is_phantom_mode = false;
|
||||||
|
bool has_exited = false;
|
||||||
|
|
||||||
bool was_running = false;
|
bool was_running = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user