diff options
| author | bunnei <bunneidev@gmail.com> | 2020-06-12 22:30:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-12 22:30:19 -0400 |
| commit | b717bb09f2a3c5ce20dcfe54fc85e1e9bee9d033 (patch) | |
| tree | f5ed9c4bf745ee0ff8e043a5b25700eb91091e8e /src/core/hle/kernel/resource_limit.cpp | |
| parent | 316cf3a25153af13390f4ca72c23b0227f775ebe (diff) | |
| parent | 55b534c5a0dcb78d9c79b9b309436fe0a45d4785 (diff) | |
Merge pull request #4010 from ogniK5377/reserve-always-break
kernel: ResourceLimit::Reserve remove useless while loop
Diffstat (limited to 'src/core/hle/kernel/resource_limit.cpp')
| -rw-r--r-- | src/core/hle/kernel/resource_limit.cpp | 6 |
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 d9beaa3a40..212e442f42 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) { const std::size_t index{ResourceTypeToIndex(resource)}; s64 new_value = current[index] + amount; - while (new_value > limit[index] && available[index] + amount <= limit[index]) { + if (new_value > limit[index] && available[index] + amount <= limit[index]) { // TODO(bunnei): This is wrong for multicore, we should wait the calling thread for timeout new_value = current[index] + amount; - - if (timeout >= 0) { - break; - } } if (new_value <= limit[index]) { |
