Browse Source

kernel: signal thread on termination completed

nce_cpp
Liam 2 years ago
parent
commit
f0c6de7dd2
  1. 11
      src/core/hle/kernel/k_thread.cpp

11
src/core/hle/kernel/k_thread.cpp

@ -415,10 +415,6 @@ void KThread::StartTermination() {
m_parent->ClearRunningThread(this); m_parent->ClearRunningThread(this);
} }
// Signal.
m_signaled = true;
KSynchronizationObject::NotifyAvailable();
// Clear previous thread in KScheduler. // Clear previous thread in KScheduler.
KScheduler::ClearPreviousThread(m_kernel, this); KScheduler::ClearPreviousThread(m_kernel, this);
@ -437,6 +433,13 @@ void KThread::FinishTermination() {
} }
} }
// Acquire the scheduler lock.
KScopedSchedulerLock sl{m_kernel};
// Signal.
m_signaled = true;
KSynchronizationObject::NotifyAvailable();
// Close the thread. // Close the thread.
this->Close(); this->Close();
} }

Loading…
Cancel
Save