Threads: removed outdated on_abort detection deemed unnecessary

May cause regressions.
This commit is contained in:
Nekotekina 2020-02-25 15:48:25 +03:00
parent 3f943945a7
commit b59bb16fad
5 changed files with 0 additions and 26 deletions

View File

@ -81,13 +81,6 @@ struct result_storage<void>
template <class Context, typename... Args>
using result_storage_t = result_storage<std::invoke_result_t<Context, Args...>>;
// Detect on_abort() method (should return void)
template <typename T, typename = void>
struct thread_on_abort : std::bool_constant<false> {};
template <typename T>
struct thread_on_abort<T, decltype(std::declval<named_thread<T>&>().on_abort())> : std::bool_constant<true> {};
// Detect on_cleanup() static member function (should return void) (in C++20 can use destroying delete instead)
template <typename T, typename = void>
struct thread_on_cleanup : std::bool_constant<false> {};
@ -457,12 +450,6 @@ public:
{
if (s == thread_state::aborting)
{
// Call on_abort() method if it's available
if constexpr (thread_on_abort<Context>())
{
Context::on_abort();
}
thread::notify_abort();
}
}

View File

@ -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);

View File

@ -37,7 +37,6 @@ protected:
public:
virtual ~cpu_thread();
void operator()();
void on_abort();
// Self identifier
const u32 id;

View File

@ -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<u32> timer_id)
{
vm::temporary_unlock(ppu);

View File

@ -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<u32> state{SYS_TIMER_STATE_STOP};