summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-11-16 18:55:21 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-11-21 15:46:55 +0100
commit2ab41ceff469cfa9b13f6357ce558b3388b0fe30 (patch)
treebc4a6798ecab65f30ec1ebd949c7a789331f4572
parentKernel: Correct behavior of Condition Variables to be more similar to real hardware. (diff)
downloadyuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar.gz
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar.bz2
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar.lz
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar.xz
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.tar.zst
yuzu-2ab41ceff469cfa9b13f6357ce558b3388b0fe30.zip
-rw-r--r--src/core/hle/kernel/svc.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index c27529f4d..4fdb6d429 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1649,16 +1649,12 @@ static ResultCode SignalProcessWideKey(Core::System& system, VAddr condition_var
std::vector<SharedPtr<Thread>> waiting_threads =
current_process->GetConditionVariableThreads(condition_variable_addr);
- // Only process up to 'target' threads, unless 'target' is -1, in which case process
+ // Only process up to 'target' threads, unless 'target' is less equal 0, in which case process
// them all.
std::size_t last = waiting_threads.size();
- if (target != -1)
+ if (target > 0)
last = std::min(waiting_threads.size(), static_cast<std::size_t>(target));
- // If there are no threads waiting on this condition variable, just exit
- if (last == 0)
- return RESULT_SUCCESS;
-
for (std::size_t index = 0; index < last; ++index) {
auto& thread = waiting_threads[index];