diff options
| author | 2020-06-12 22:30:19 -0400 | |
|---|---|---|
| committer | 2020-06-12 22:30:19 -0400 | |
| commit | e1911e5c8b1d18eb9d328b253d0834f04d420e2f (patch) | |
| tree | f5ed9c4bf745ee0ff8e043a5b25700eb91091e8e | |
| parent | Merge pull request #4027 from ReinUsesLisp/3d-slices (diff) | |
| parent | kernel: ResourceLimit::Reserve remove useless while loop (diff) | |
| download | yuzu-e1911e5c8b1d18eb9d328b253d0834f04d420e2f.tar.gz yuzu-e1911e5c8b1d18eb9d328b253d0834f04d420e2f.tar.xz yuzu-e1911e5c8b1d18eb9d328b253d0834f04d420e2f.zip | |
Merge pull request #4010 from ogniK5377/reserve-always-break
kernel: ResourceLimit::Reserve remove useless while loop
Diffstat (limited to '')
| -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 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]) { |