From b59bb16fad0f7f253017eb7de1579cc54fa13510 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 25 Feb 2020 15:48:25 +0300 Subject: [PATCH] Threads: removed outdated on_abort detection deemed unnecessary May cause regressions. --- Utilities/Thread.h | 13 ------------- rpcs3/Emu/CPU/CPUThread.cpp | 5 ----- rpcs3/Emu/CPU/CPUThread.h | 1 - rpcs3/Emu/Cell/lv2/sys_timer.cpp | 6 ------ rpcs3/Emu/Cell/lv2/sys_timer.h | 1 - 5 files changed, 26 deletions(-) diff --git a/Utilities/Thread.h b/Utilities/Thread.h index cccc97e832..380d48321b 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -81,13 +81,6 @@ struct result_storage template using result_storage_t = result_storage>; -// Detect on_abort() method (should return void) -template -struct thread_on_abort : std::bool_constant {}; - -template -struct thread_on_abort&>().on_abort())> : std::bool_constant {}; - // Detect on_cleanup() static member function (should return void) (in C++20 can use destroying delete instead) template struct thread_on_cleanup : std::bool_constant {}; @@ -457,12 +450,6 @@ public: { if (s == thread_state::aborting) { - // Call on_abort() method if it's available - if constexpr (thread_on_abort()) - { - Context::on_abort(); - } - thread::notify_abort(); } } diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 186bc9d167..43d72b32e1 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -387,11 +387,6 @@ void cpu_thread::operator()() g_cpu_suspend_lock.lock_unlock(); } -void cpu_thread::on_abort() -{ - state += cpu_flag::exit; -} - cpu_thread::~cpu_thread() { vm::cleanup_unlock(*this); diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index 1e90e82df3..dfe7735f3f 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -37,7 +37,6 @@ protected: public: virtual ~cpu_thread(); void operator()(); - void on_abort(); // Self identifier const u32 id; diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp index 96090cd901..d8fc9871b2 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_timer.cpp @@ -60,12 +60,6 @@ void lv2_timer_context::operator()() } } -void lv2_timer_context::on_abort() -{ - // Signal thread using invalid state - state = -1; -} - error_code sys_timer_create(ppu_thread& ppu, vm::ptr timer_id) { vm::temporary_unlock(ppu); diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.h b/rpcs3/Emu/Cell/lv2/sys_timer.h index 0de1f4ade4..3202dfbe05 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.h +++ b/rpcs3/Emu/Cell/lv2/sys_timer.h @@ -26,7 +26,6 @@ struct lv2_timer_context : lv2_obj static const u32 id_base = 0x11000000; void operator()(); - void on_abort(); shared_mutex mutex; atomic_t state{SYS_TIMER_STATE_STOP};