summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar David Marcec2020-05-29 13:48:01 +1000
committerGravatar David Marcec2020-05-29 13:48:01 +1000
commit43bf860b2237cfa873e2452dd8d0b5f43193a05e (patch)
treeda36560cbb84f370878d5d3b18d3a217ed106ffc
parentMerge pull request #4002 from lat9nq/fix-nix-mod-directories (diff)
downloadyuzu-43bf860b2237cfa873e2452dd8d0b5f43193a05e.tar.gz
yuzu-43bf860b2237cfa873e2452dd8d0b5f43193a05e.tar.xz
yuzu-43bf860b2237cfa873e2452dd8d0b5f43193a05e.zip
kernel: ResourceLimit::Reserve remove useless while loop
Timeout is a u64, it will always be >= 0
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/resource_limit.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp
index d9beaa3a4..212e442f4 100644
--- a/src/core/hle/kernel/resource_limit.cpp
+++ b/src/core/hle/kernel/resource_limit.cpp
@@ -24,13 +24,9 @@ bool ResourceLimit::Reserve(ResourceType resource, s64 amount, u64 timeout) {
24 const std::size_t index{ResourceTypeToIndex(resource)}; 24 const std::size_t index{ResourceTypeToIndex(resource)};
25 25
26 s64 new_value = current[index] + amount; 26 s64 new_value = current[index] + amount;
27 while (new_value > limit[index] && available[index] + amount <= limit[index]) { 27 if (new_value > limit[index] && available[index] + amount <= limit[index]) {
28 // TODO(bunnei): This is wrong for multicore, we should wait the calling thread for timeout 28 // TODO(bunnei): This is wrong for multicore, we should wait the calling thread for timeout
29 new_value = current[index] + amount; 29 new_value = current[index] + amount;
30
31 if (timeout >= 0) {
32 break;
33 }
34 } 30 }
35 31
36 if (new_value <= limit[index]) { 32 if (new_value <= limit[index]) {