summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorChloe Marcec <dmarcecguzman@gmail.com>2021-02-02 03:23:00 +0100
committerChloe Marcec <dmarcecguzman@gmail.com>2021-02-02 03:23:00 +0100
commit9e4b2d60bc4827552b0d74675ae03fec06f73452 (patch)
tree99b841a8e2cd6bf70117bb7e93a8719dafa3f726 /src/core
parentfix compile error (diff)
downloadyuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar.gz
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar.bz2
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar.lz
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar.xz
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.tar.zst
yuzu-9e4b2d60bc4827552b0d74675ae03fec06f73452.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/k_light_condition_variable.h21
-rw-r--r--src/core/hle/kernel/k_resource_limit.cpp2
-rw-r--r--src/core/hle/kernel/k_resource_limit.h11
3 files changed, 15 insertions, 19 deletions
diff --git a/src/core/hle/kernel/k_light_condition_variable.h b/src/core/hle/kernel/k_light_condition_variable.h
index 26573a239..26d94d7c0 100644
--- a/src/core/hle/kernel/k_light_condition_variable.h
+++ b/src/core/hle/kernel/k_light_condition_variable.h
@@ -17,44 +17,41 @@ namespace Kernel {
class KernelCore;
class KLightConditionVariable {
-private:
- KThreadQueue m_thread_queue;
-
public:
- KLightConditionVariable(KernelCore& kernel) : m_thread_queue(kernel), kernel(kernel) {}
+ explicit KLightConditionVariable(KernelCore& kernel) : thread_queue(kernel), kernel(kernel) {}
- void Wait(KLightLock* lock, s64 timeout = -1ll) {
+ void Wait(KLightLock* lock, s64 timeout = -1) {
WaitImpl(lock, timeout);
lock->Lock();
}
void Broadcast() {
KScopedSchedulerLock lk{kernel};
- while (m_thread_queue.WakeupFrontThread() != nullptr) {
- /* We want to signal all threads, and so should continue waking up until there's nothing
- * to wake. */
+ while (thread_queue.WakeupFrontThread() != nullptr) {
+ // We want to signal all threads, and so should continue waking up until there's nothing
+ // to wake.
}
}
private:
void WaitImpl(KLightLock* lock, s64 timeout) {
KThread* owner = GetCurrentThreadPointer(kernel);
- // KHardwareTimer* timer;
- /* Sleep the thread. */
+ // Sleep the thread.
{
KScopedSchedulerLockAndSleep lk(kernel, owner, timeout);
lock->Unlock();
- if (!m_thread_queue.SleepThread(owner)) {
+ if (!thread_queue.SleepThread(owner)) {
lk.CancelSleep();
return;
}
}
- /* Cancel the task that the sleep setup. */
+ // Cancel the task that the sleep setup.
kernel.TimeManager().UnscheduleTimeEvent(owner);
}
KernelCore& kernel;
+ KThreadQueue thread_queue;
};
} // namespace Kernel
diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp
index 3cee8d0f7..ab2ab683f 100644
--- a/src/core/hle/kernel/k_resource_limit.cpp
+++ b/src/core/hle/kernel/k_resource_limit.cpp
@@ -13,9 +13,7 @@
#include "core/hle/kernel/svc_results.h"
namespace Kernel {
-namespace {
constexpr s64 DefaultTimeout = 10000000000; // 10 seconds
-}
KResourceLimit::KResourceLimit(KernelCore& kernel, Core::System& system)
: Object{kernel}, lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {}
diff --git a/src/core/hle/kernel/k_resource_limit.h b/src/core/hle/kernel/k_resource_limit.h
index 5f916c99c..6b3437ea6 100644
--- a/src/core/hle/kernel/k_resource_limit.h
+++ b/src/core/hle/kernel/k_resource_limit.h
@@ -37,7 +37,7 @@ constexpr bool IsValidResourceType(LimitableResource type) {
class KResourceLimit final : public Object {
public:
- KResourceLimit(KernelCore& kernel, Core::System& system);
+ explicit KResourceLimit(KernelCore& kernel, Core::System& system);
~KResourceLimit();
s64 GetLimitValue(LimitableResource which) const;
@@ -67,10 +67,11 @@ public:
virtual void Finalize() override {}
private:
- std::array<s64, static_cast<std::size_t>(LimitableResource::Count)> limit_values{};
- std::array<s64, static_cast<std::size_t>(LimitableResource::Count)> current_values{};
- std::array<s64, static_cast<std::size_t>(LimitableResource::Count)> current_hints{};
- std::array<s64, static_cast<std::size_t>(LimitableResource::Count)> peak_values{};
+ using ResourceArray = std::array<s64, static_cast<std::size_t>(LimitableResource::Count)>;
+ ResourceArray limit_values{};
+ ResourceArray current_values{};
+ ResourceArray current_hints{};
+ ResourceArray peak_values{};
mutable KLightLock lock;
s32 waiter_count{};
KLightConditionVariable cond_var;