summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-01-04 16:44:38 +0100
committerSubv <subv2112@gmail.com>2017-01-04 21:58:50 +0100
commitcef5f45de2fd64f0728d4504d0ad7434cb8ac519 (patch)
treea8297434a72bc21d1cec17e3414766ece0ec0054 /src/core/hle/kernel/thread.cpp
parentKernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes (diff)
downloadyuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.gz
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.bz2
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.lz
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.xz
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.zst
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.zip
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 3a5a67450..aa99d18c7 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -72,7 +72,8 @@ Thread* GetCurrentThread() {
* @return True if the thread is waiting, false otherwise
*/
static bool CheckWait_WaitObject(const Thread* thread, WaitObject* wait_object) {
- if (thread->status != THREADSTATUS_WAIT_SYNCH)
+ if (thread->status != THREADSTATUS_WAIT_SYNCH_ALL &&
+ thread->status != THREADSTATUS_WAIT_SYNCH_ANY)
return false;
auto itr = std::find(thread->wait_objects.begin(), thread->wait_objects.end(), wait_object);
@@ -253,7 +254,7 @@ void WaitCurrentThread_WaitSynchronization(std::vector<SharedPtr<WaitObject>> wa
Thread* thread = GetCurrentThread();
thread->wait_set_output = wait_set_output;
thread->wait_objects = std::move(wait_objects);
- thread->status = THREADSTATUS_WAIT_SYNCH;
+ thread->status = THREADSTATUS_WAIT_SYNCH_ANY;
}
void WaitCurrentThread_ArbitrateAddress(VAddr wait_address) {
@@ -281,7 +282,8 @@ static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) {
return;
}
- if (thread->status == THREADSTATUS_WAIT_SYNCH || thread->status == THREADSTATUS_WAIT_ARB) {
+ if (thread->status == THREADSTATUS_WAIT_SYNCH_ANY ||
+ thread->status == THREADSTATUS_WAIT_SYNCH_ALL || thread->status == THREADSTATUS_WAIT_ARB) {
thread->wait_set_output = false;
// Remove the thread from each of its waiting objects' waitlists
for (auto& object : thread->wait_objects)
@@ -306,7 +308,8 @@ void Thread::WakeAfterDelay(s64 nanoseconds) {
void Thread::ResumeFromWait() {
switch (status) {
- case THREADSTATUS_WAIT_SYNCH:
+ case THREADSTATUS_WAIT_SYNCH_ALL:
+ case THREADSTATUS_WAIT_SYNCH_ANY:
case THREADSTATUS_WAIT_ARB:
case THREADSTATUS_WAIT_SLEEP:
break;