diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index f3a8aa4aa..0a0ad7cfb 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -126,6 +126,14 @@ static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) { | |||
| 126 | resume = thread->wakeup_callback(ThreadWakeupReason::Timeout, thread, nullptr, 0); | 126 | resume = thread->wakeup_callback(ThreadWakeupReason::Timeout, thread, nullptr, 0); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | if (thread->mutex_wait_address != 0 || thread->condvar_wait_address != 0 || | ||
| 130 | thread->wait_handle) { | ||
| 131 | ASSERT(thread->status == THREADSTATUS_WAIT_MUTEX); | ||
| 132 | thread->mutex_wait_address = 0; | ||
| 133 | thread->condvar_wait_address = 0; | ||
| 134 | thread->wait_handle = 0; | ||
| 135 | } | ||
| 136 | |||
| 129 | if (resume) | 137 | if (resume) |
| 130 | thread->ResumeFromWait(); | 138 | thread->ResumeFromWait(); |
| 131 | } | 139 | } |
| @@ -151,6 +159,7 @@ void Thread::ResumeFromWait() { | |||
| 151 | case THREADSTATUS_WAIT_HLE_EVENT: | 159 | case THREADSTATUS_WAIT_HLE_EVENT: |
| 152 | case THREADSTATUS_WAIT_SLEEP: | 160 | case THREADSTATUS_WAIT_SLEEP: |
| 153 | case THREADSTATUS_WAIT_IPC: | 161 | case THREADSTATUS_WAIT_IPC: |
| 162 | case THREADSTATUS_WAIT_MUTEX: | ||
| 154 | break; | 163 | break; |
| 155 | 164 | ||
| 156 | case THREADSTATUS_READY: | 165 | case THREADSTATUS_READY: |
| @@ -256,7 +265,9 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 256 | thread->last_running_ticks = CoreTiming::GetTicks(); | 265 | thread->last_running_ticks = CoreTiming::GetTicks(); |
| 257 | thread->processor_id = processor_id; | 266 | thread->processor_id = processor_id; |
| 258 | thread->wait_objects.clear(); | 267 | thread->wait_objects.clear(); |
| 259 | thread->wait_address = 0; | 268 | thread->mutex_wait_address = 0; |
| 269 | thread->condvar_wait_address = 0; | ||
| 270 | thread->wait_handle = 0; | ||
| 260 | thread->name = std::move(name); | 271 | thread->name = std::move(name); |
| 261 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); | 272 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); |
| 262 | thread->owner_process = owner_process; | 273 | thread->owner_process = owner_process; |