summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
authorGravatar Subv2017-01-04 10:44:38 -0500
committerGravatar Subv2017-01-04 15:58:50 -0500
commitcef5f45de2fd64f0728d4504d0ad7434cb8ac519 (patch)
treea8297434a72bc21d1cec17e3414766ece0ec0054 /src/core/hle/svc.cpp
parentKernel/Mutex: Propagate thread priority changes to other threads inheriting t... (diff)
downloadyuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.gz
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.tar.xz
yuzu-cef5f45de2fd64f0728d4504d0ad7434cb8ac519.zip
Kernel: Use different thread statuses when a thread calls WaitSynchronization1 and WaitSynchronizationN with wait_all = true.
This commit removes the overly general THREADSTATUS_WAIT_SYNCH and replaces it with two more granular statuses: THREADSTATUS_WAIT_SYNCH_ANY when a thread waits on objects via WaitSynchronization1 or WaitSynchronizationN with wait_all = false. THREADSTATUS_WAIT_SYNCH_ALL when a thread waits on objects via WaitSynchronizationN with wait_all = true.
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 160f27c98..1e1ca5180 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -278,7 +278,7 @@ static ResultCode WaitSynchronization1(Kernel::Handle handle, s64 nano_seconds)
278 return ERR_SYNC_TIMEOUT; 278 return ERR_SYNC_TIMEOUT;
279 279
280 object->AddWaitingThread(thread); 280 object->AddWaitingThread(thread);
281 thread->status = THREADSTATUS_WAIT_SYNCH; 281 thread->status = THREADSTATUS_WAIT_SYNCH_ANY;
282 282
283 // Create an event to wake the thread up after the specified nanosecond delay has passed 283 // Create an event to wake the thread up after the specified nanosecond delay has passed
284 thread->WakeAfterDelay(nano_seconds); 284 thread->WakeAfterDelay(nano_seconds);
@@ -351,7 +351,7 @@ static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 ha
351 return ERR_SYNC_TIMEOUT; 351 return ERR_SYNC_TIMEOUT;
352 352
353 // Put the thread to sleep 353 // Put the thread to sleep
354 thread->status = THREADSTATUS_WAIT_SYNCH; 354 thread->status = THREADSTATUS_WAIT_SYNCH_ALL;
355 355
356 // Add the thread to each of the objects' waiting threads. 356 // Add the thread to each of the objects' waiting threads.
357 for (auto& object : objects) { 357 for (auto& object : objects) {
@@ -393,7 +393,7 @@ static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 ha
393 return ERR_SYNC_TIMEOUT; 393 return ERR_SYNC_TIMEOUT;
394 394
395 // Put the thread to sleep 395 // Put the thread to sleep
396 thread->status = THREADSTATUS_WAIT_SYNCH; 396 thread->status = THREADSTATUS_WAIT_SYNCH_ANY;
397 397
398 // Clear the thread's waitlist, we won't use it for wait_all = false 398 // Clear the thread's waitlist, we won't use it for wait_all = false
399 thread->wait_objects.clear(); 399 thread->wait_objects.clear();