mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-16 16:21:02 +00:00
Threads: Remove unused on_wait() detection to simplify code
This commit is contained in:
parent
136d769895
commit
3f943945a7
@ -95,13 +95,6 @@ struct thread_on_cleanup : std::bool_constant<false> {};
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
struct thread_on_cleanup<T, decltype(named_thread<T>::on_cleanup(std::declval<named_thread<T>*>()))> : std::bool_constant<true> {};
|
struct thread_on_cleanup<T, decltype(named_thread<T>::on_cleanup(std::declval<named_thread<T>*>()))> : std::bool_constant<true> {};
|
||||||
|
|
||||||
// Detect on_wait() method (should return bool)
|
|
||||||
template <typename T, typename = bool>
|
|
||||||
struct thread_on_wait : std::bool_constant<false> {};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
struct thread_on_wait<T, decltype(std::declval<named_thread<T>&>().on_wait())> : std::bool_constant<true> {};
|
|
||||||
|
|
||||||
template <typename T, typename = void>
|
template <typename T, typename = void>
|
||||||
struct thread_thread_name : std::bool_constant<false> {};
|
struct thread_thread_name : std::bool_constant<false> {};
|
||||||
|
|
||||||
@ -345,14 +338,6 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (thread_on_wait<Context>())
|
|
||||||
{
|
|
||||||
if (!static_cast<named_thread*>(_this)->on_wait())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_this->m_state_notifier.release(data);
|
_this->m_state_notifier.release(data);
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
@ -366,15 +351,6 @@ class named_thread final : public Context, result_storage_t<Context>, thread_bas
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if constexpr (thread_on_wait<Context>())
|
|
||||||
{
|
|
||||||
if (!static_cast<named_thread*>(_this)->on_wait())
|
|
||||||
{
|
|
||||||
_this->m_state_notifier.release(nullptr);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user