From 1a302d4d473a80164082b7c8ecc44de0c08442ad Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 30 Jan 2019 12:26:11 -0500 Subject: [PATCH 1/3] kernel/readable_event: Remove unnecessary WakeupAllWaitingThreads() override This just calls the base variant of the function, so it can be removed. --- src/core/hle/kernel/readable_event.cpp | 4 ---- src/core/hle/kernel/readable_event.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/core/hle/kernel/readable_event.cpp b/src/core/hle/kernel/readable_event.cpp index 6973e580cf..0e5083f705 100644 --- a/src/core/hle/kernel/readable_event.cpp +++ b/src/core/hle/kernel/readable_event.cpp @@ -44,8 +44,4 @@ ResultCode ReadableEvent::Reset() { return RESULT_SUCCESS; } -void ReadableEvent::WakeupAllWaitingThreads() { - WaitObject::WakeupAllWaitingThreads(); -} - } // namespace Kernel diff --git a/src/core/hle/kernel/readable_event.h b/src/core/hle/kernel/readable_event.h index 80b3b0abaf..77a9c362cb 100644 --- a/src/core/hle/kernel/readable_event.h +++ b/src/core/hle/kernel/readable_event.h @@ -39,8 +39,6 @@ public: bool ShouldWait(Thread* thread) const override; void Acquire(Thread* thread) override; - void WakeupAllWaitingThreads() override; - /// Unconditionally clears the readable event's state. void Clear(); From 4596ef5274e05c5e022bd21ba7472ef6ab915eb8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 30 Jan 2019 12:27:02 -0500 Subject: [PATCH 2/3] kernel/timer: Remove unnecessary WakeupAllWaitingThreads() override This implementation just calls the base class variant of the function, so this isn't necessary. --- src/core/hle/kernel/timer.cpp | 4 ---- src/core/hle/kernel/timer.h | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 2c4f50e2b1..3afe60469f 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -66,10 +66,6 @@ void Timer::Clear() { signaled = false; } -void Timer::WakeupAllWaitingThreads() { - WaitObject::WakeupAllWaitingThreads(); -} - void Timer::Signal(int cycles_late) { LOG_TRACE(Kernel, "Timer {} fired", GetObjectId()); diff --git a/src/core/hle/kernel/timer.h b/src/core/hle/kernel/timer.h index 12915c1b11..ce3e744264 100644 --- a/src/core/hle/kernel/timer.h +++ b/src/core/hle/kernel/timer.h @@ -51,8 +51,6 @@ public: bool ShouldWait(Thread* thread) const override; void Acquire(Thread* thread) override; - void WakeupAllWaitingThreads() override; - /** * Starts the timer, with the specified initial delay and interval. * @param initial Delay until the timer is first fired From a3cdd773c34ccfbfaa4a59724d94b6d8ca7c64e7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 30 Jan 2019 12:41:17 -0500 Subject: [PATCH 3/3] kernel/wait_object: Devirtualize functions related to manipulating the thread list directly No inheritors of the WaitObject class actually make use of their own implementations of these functions, so they can be made non-virtual. It's also kind of sketchy to allow overriding how the threads get added to the list anyways, given the kernel itself on the actual hardware doesn't seem to customize based off this. --- src/core/hle/kernel/wait_object.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/hle/kernel/wait_object.h b/src/core/hle/kernel/wait_object.h index d70b678935..5987fb9716 100644 --- a/src/core/hle/kernel/wait_object.h +++ b/src/core/hle/kernel/wait_object.h @@ -33,19 +33,19 @@ public: * Add a thread to wait on this object * @param thread Pointer to thread to add */ - virtual void AddWaitingThread(SharedPtr thread); + void AddWaitingThread(SharedPtr thread); /** * Removes a thread from waiting on this object (e.g. if it was resumed already) * @param thread Pointer to thread to remove */ - virtual void RemoveWaitingThread(Thread* thread); + void RemoveWaitingThread(Thread* thread); /** * Wake up all threads waiting on this object that can be awoken, in priority order, * and set the synchronization result and output of the thread. */ - virtual void WakeupAllWaitingThreads(); + void WakeupAllWaitingThreads(); /** * Wakes up a single thread waiting on this object.