SCC: Small corrections to CancelSynchronization

This commit is contained in:
Fernando Sahmkow
2020-03-07 10:24:46 -04:00
parent 44cb9997b3
commit a66c61ca2d
3 changed files with 14 additions and 2 deletions

View File

@ -139,13 +139,14 @@ ResultCode Thread::Start() {
void Thread::CancelWait() {
SchedulerLock lock(kernel);
if (GetSchedulingStatus() != ThreadSchedStatus::Paused) {
if (GetSchedulingStatus() != ThreadSchedStatus::Paused || !is_waiting_on_sync) {
is_sync_cancelled = true;
return;
}
//TODO(Blinkhawk): Implement cancel of server session
is_sync_cancelled = false;
SetSynchronizationResults(nullptr, ERR_SYNCHRONIZATION_CANCELED);
ResumeFromWait();
SetStatus(ThreadStatus::Ready);
}
static void ResetThreadContext32(Core::ARM_Interface::ThreadContext32& context, u32 stack_top,