mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 03:25:16 +00:00
Abort named_thread in cpu_thread::stop_all
This commit is contained in:
parent
e982871ab5
commit
223319dd2e
2 changed files with 22 additions and 1 deletions
|
@ -310,6 +310,22 @@ void cpu_thread::notify()
|
|||
}
|
||||
}
|
||||
|
||||
void cpu_thread::abort()
|
||||
{
|
||||
if (id_type() == 1)
|
||||
{
|
||||
*static_cast<named_thread<ppu_thread>*>(this) = thread_state::aborting;
|
||||
}
|
||||
else if (id_type() == 2)
|
||||
{
|
||||
*static_cast<named_thread<spu_thread>*>(this) = thread_state::aborting;
|
||||
}
|
||||
else
|
||||
{
|
||||
fmt::throw_exception("Invalid cpu_thread type");
|
||||
}
|
||||
}
|
||||
|
||||
std::string cpu_thread::dump() const
|
||||
{
|
||||
return fmt::format("Type: %s\n" "State: %s\n", typeid(*this).name(), state.load());
|
||||
|
@ -391,7 +407,7 @@ void cpu_thread::stop_all() noexcept
|
|||
for_all_cpu([](cpu_thread* cpu)
|
||||
{
|
||||
cpu->state += cpu_flag::dbg_global_stop;
|
||||
cpu->notify();
|
||||
cpu->abort();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -81,6 +81,11 @@ public:
|
|||
// Upcast and notify
|
||||
void notify();
|
||||
|
||||
private:
|
||||
// Upcast and abort
|
||||
void abort();
|
||||
|
||||
public:
|
||||
// Thread stats for external observation
|
||||
static atomic_t<u64> g_threads_created, g_threads_deleted;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue