kern: devirtualize KReadableEvent::Reset, KWorkerTask::DoWorkerTask
This commit is contained in:
@@ -18,16 +18,23 @@
|
||||
|
||||
namespace ams::kern {
|
||||
|
||||
class KWorkerTask {
|
||||
/* NOTE: We inherit KWorkerTask from KSynchronizationObject in order to devirtualize DoWorkerTask, which is exclusive to KThread/KProcess. */
|
||||
/* This should be reverted, if Nintendo adds new types of worker tasks in the future. */
|
||||
|
||||
/* Nintendo has class KWorkerTask { ... } with identical interface but DoWorkerTask() virtual. */
|
||||
|
||||
class KWorkerTask : public KSynchronizationObject {
|
||||
private:
|
||||
KWorkerTask *m_next_task;
|
||||
public:
|
||||
constexpr ALWAYS_INLINE KWorkerTask() : m_next_task(nullptr) { /* ... */ }
|
||||
constexpr ALWAYS_INLINE explicit KWorkerTask(util::ConstantInitializeTag) : KSynchronizationObject(util::ConstantInitialize), m_next_task(nullptr) { /* ... */ }
|
||||
|
||||
ALWAYS_INLINE explicit KWorkerTask() : m_next_task(nullptr) { /* ... */ }
|
||||
|
||||
constexpr ALWAYS_INLINE KWorkerTask *GetNextTask() const { return m_next_task; }
|
||||
constexpr ALWAYS_INLINE void SetNextTask(KWorkerTask *task) { m_next_task = task; }
|
||||
|
||||
virtual void DoWorkerTask() = 0;
|
||||
void DoWorkerTask();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user