mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
Implement thread_ctrl::emergency_exit()
Replace exception throws with this.
This commit is contained in:
parent
814c73407d
commit
07e1766a7c
4 changed files with 62 additions and 16 deletions
|
@ -2018,6 +2018,31 @@ u64 thread_base::get_cycles()
|
|||
}
|
||||
}
|
||||
|
||||
void thread_ctrl::emergency_exit(std::string_view reason)
|
||||
{
|
||||
sig_log.fatal("Thread terminated due to fatal error: %s", reason);
|
||||
|
||||
if (const auto _this = g_tls_this_thread)
|
||||
{
|
||||
if (_this->finalize(0))
|
||||
{
|
||||
delete _this;
|
||||
}
|
||||
|
||||
// Do some not very useful cleanup
|
||||
thread_base::finalize();
|
||||
|
||||
#ifdef _WIN32
|
||||
_endthreadex(0);
|
||||
#else
|
||||
pthread_exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Assume main thread
|
||||
report_fatal_error(std::string(reason));
|
||||
}
|
||||
|
||||
void thread_ctrl::detect_cpu_layout()
|
||||
{
|
||||
if (!g_native_core_layout.compare_and_swap_test(native_core_arrangement::undefined, native_core_arrangement::generic))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue