diff options
| author | 2015-05-01 19:05:18 -0400 | |
|---|---|---|
| committer | 2015-05-01 19:05:18 -0400 | |
| commit | 6a2d8c46f21e8813e0472dba28932ed461ce1a66 (patch) | |
| tree | d7057cf9926c822c12cc7d82814a252db79ca600 /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #717 from linkmauve/useless-auto (diff) | |
| parent | Qt: Shutdown game on emulator close event. (diff) | |
| download | yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.gz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.tar.xz yuzu-6a2d8c46f21e8813e0472dba28932ed461ce1a66.zip | |
Merge pull request #713 from bunnei/qt-emuthread-fixes
Fix emulation state resetting to support multiple emulation sessions
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 33d66b986..d678f5f6f 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | namespace Kernel { | 23 | namespace Kernel { |
| 24 | 24 | ||
| 25 | /// Event type for the thread wake up event | 25 | /// Event type for the thread wake up event |
| 26 | static int ThreadWakeupEventType = -1; | 26 | static int ThreadWakeupEventType; |
| 27 | 27 | ||
| 28 | bool Thread::ShouldWait() { | 28 | bool Thread::ShouldWait() { |
| 29 | return status != THREADSTATUS_DEAD; | 29 | return status != THREADSTATUS_DEAD; |
| @@ -42,7 +42,7 @@ static Common::ThreadQueueList<Thread*, THREADPRIO_LOWEST+1> ready_queue; | |||
| 42 | static Thread* current_thread; | 42 | static Thread* current_thread; |
| 43 | 43 | ||
| 44 | // The first available thread id at startup | 44 | // The first available thread id at startup |
| 45 | static u32 next_thread_id = 1; | 45 | static u32 next_thread_id; |
| 46 | 46 | ||
| 47 | /** | 47 | /** |
| 48 | * Creates a new thread ID | 48 | * Creates a new thread ID |
| @@ -497,6 +497,12 @@ void Thread::SetWaitSynchronizationOutput(s32 output) { | |||
| 497 | void ThreadingInit() { | 497 | void ThreadingInit() { |
| 498 | ThreadWakeupEventType = CoreTiming::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); | 498 | ThreadWakeupEventType = CoreTiming::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); |
| 499 | 499 | ||
| 500 | current_thread = nullptr; | ||
| 501 | next_thread_id = 1; | ||
| 502 | |||
| 503 | thread_list.clear(); | ||
| 504 | ready_queue.clear(); | ||
| 505 | |||
| 500 | // Setup the idle thread | 506 | // Setup the idle thread |
| 501 | SetupIdleThread(); | 507 | SetupIdleThread(); |
| 502 | } | 508 | } |