summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorChloe Marcec <dmarcecguzman@gmail.com>2021-01-30 11:19:49 +0100
committerChloe Marcec <dmarcecguzman@gmail.com>2021-01-30 11:19:49 +0100
commit7791cfd9603d983fe58d3463e94d87448ad9e5a6 (patch)
treeff821b032dbbcbf5b1efae432437c644c01f4fda /src/core/hle
parentMove to GetGlobalTimeNs, fix GetTotalPhysicalMemoryAvailable (diff)
downloadyuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar.gz
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar.bz2
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar.lz
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar.xz
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.tar.zst
yuzu-7791cfd9603d983fe58d3463e94d87448ad9e5a6.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/k_resource_limit.cpp16
-rw-r--r--src/core/hle/kernel/k_resource_limit.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp
index b3076b030..65c30e9b3 100644
--- a/src/core/hle/kernel/k_resource_limit.cpp
+++ b/src/core/hle/kernel/k_resource_limit.cpp
@@ -18,14 +18,14 @@ constexpr s64 DefaultTimeout = 10000000000; // 10 seconds
}
KResourceLimit::KResourceLimit(KernelCore& kernel, Core::System& system)
- : Object{kernel}, m_lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {}
+ : Object{kernel}, lock{kernel}, cond_var{kernel}, kernel{kernel}, system(system) {}
KResourceLimit::~KResourceLimit() = default;
s64 KResourceLimit::GetLimitValue(LimitableResource which) const {
const auto index = static_cast<std::size_t>(which);
s64 value{};
{
- KScopedLightLock lk{m_lock};
+ KScopedLightLock lk{lock};
value = limit_values[index];
ASSERT(value >= 0);
ASSERT(current_values[index] <= limit_values[index]);
@@ -51,7 +51,7 @@ s64 KResourceLimit::GetPeakValue(LimitableResource which) const {
const auto index = static_cast<std::size_t>(which);
s64 value{};
{
- KScopedLightLock lk{m_lock};
+ KScopedLightLock lk{lock};
value = peak_values[index];
ASSERT(value >= 0);
ASSERT(current_values[index] <= limit_values[index]);
@@ -64,7 +64,7 @@ s64 KResourceLimit::GetFreeValue(LimitableResource which) const {
const auto index = static_cast<std::size_t>(which);
s64 value{};
{
- KScopedLightLock lk(m_lock);
+ KScopedLightLock lk(lock);
ASSERT(current_values[index] >= 0);
ASSERT(current_values[index] <= limit_values[index]);
ASSERT(current_hints[index] <= current_values[index]);
@@ -76,7 +76,7 @@ s64 KResourceLimit::GetFreeValue(LimitableResource which) const {
ResultCode KResourceLimit::SetLimitValue(LimitableResource which, s64 value) {
const auto index = static_cast<std::size_t>(which);
- KScopedLightLock lk(m_lock);
+ KScopedLightLock lk(lock);
R_UNLESS(current_values[index] <= value, Svc::ResultInvalidState);
limit_values[index] = value;
@@ -91,7 +91,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value) {
bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) {
ASSERT(value >= 0);
const auto index = static_cast<std::size_t>(which);
- KScopedLightLock lk(m_lock);
+ KScopedLightLock lk(lock);
ASSERT(current_hints[index] <= current_values[index]);
if (current_hints[index] >= limit_values[index]) {
@@ -118,7 +118,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) {
if (current_hints[index] + value <= limit_values[index] &&
(timeout < 0 || system.CoreTiming().GetGlobalTimeNs().count() < timeout)) {
waiter_count++;
- cond_var.Wait(&m_lock, timeout);
+ cond_var.Wait(&lock, timeout);
waiter_count--;
} else {
break;
@@ -137,7 +137,7 @@ void KResourceLimit::Release(LimitableResource which, s64 value, s64 hint) {
ASSERT(hint >= 0);
const auto index = static_cast<std::size_t>(which);
- KScopedLightLock lk(m_lock);
+ KScopedLightLock lk(lock);
ASSERT(current_values[index] <= limit_values[index]);
ASSERT(current_hints[index] <= current_values[index]);
ASSERT(value <= current_values[index]);
diff --git a/src/core/hle/kernel/k_resource_limit.h b/src/core/hle/kernel/k_resource_limit.h
index 84c59177c..5f916c99c 100644
--- a/src/core/hle/kernel/k_resource_limit.h
+++ b/src/core/hle/kernel/k_resource_limit.h
@@ -71,7 +71,7 @@ private:
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{};
- mutable KLightLock m_lock;
+ mutable KLightLock lock;
s32 waiter_count{};
KLightConditionVariable cond_var;
KernelCore& kernel;