فهرست منبع

Merge pull request #466 from Subv/wake

Thread: Prevent waking a thread multiple times.
bunnei 11 سال پیش
والد
کامیت
542b0b0057
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      src/core/hle/kernel/thread.cpp

+ 3 - 0
src/core/hle/kernel/thread.cpp

@@ -263,6 +263,9 @@ void WakeThreadAfterDelay(Thread* thread, s64 nanoseconds) {
 
 /// Resumes a thread from waiting by marking it as "ready"
 void Thread::ResumeFromWait() {
+    // Cancel any outstanding wakeup events
+    CoreTiming::UnscheduleEvent(ThreadWakeupEventType, GetHandle());
+
     status &= ~THREADSTATUS_WAIT;
     wait_object = nullptr;
     wait_type = WAITTYPE_NONE;