summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/thread.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index ee7531f2d..7166e9b07 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -120,8 +120,11 @@ void Thread::ResumeFromWait() {
}
void Thread::CancelWait() {
- ASSERT(GetStatus() == ThreadStatus::WaitSynch);
- ClearWaitObjects();
+ if (GetSchedulingStatus() != ThreadSchedStatus::Paused) {
+ is_sync_cancelled = true;
+ return;
+ }
+ is_sync_cancelled = false;
SetWaitSynchronizationResult(ERR_SYNCHRONIZATION_CANCELED);
ResumeFromWait();
}
@@ -306,8 +309,16 @@ void Thread::UpdatePriority() {
return;
}
+ if (GetStatus() == ThreadStatus::WaitCondVar) {
+ owner_process->RemoveConditionVariableThread(this);
+ }
+
SetCurrentPriority(new_priority);
+ if (GetStatus() == ThreadStatus::WaitCondVar) {
+ owner_process->InsertConditionVariableThread(this);
+ }
+
if (!lock_owner) {
return;
}