summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.h
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/kernel/thread.h
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/kernel/thread.h')
-rw-r--r--src/core/hle/kernel/thread.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index e2f0cc831..6cd8c20e2 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -31,13 +31,14 @@ enum ThreadProcessorId : s32 {
31}; 31};
32 32
33enum ThreadStatus { 33enum ThreadStatus {
34 THREADSTATUS_RUNNING, ///< Currently running 34 THREADSTATUS_RUNNING, ///< Currently running
35 THREADSTATUS_READY, ///< Ready to run 35 THREADSTATUS_READY, ///< Ready to run
36 THREADSTATUS_WAIT_ARB, ///< Waiting on an address arbiter 36 THREADSTATUS_WAIT_ARB, ///< Waiting on an address arbiter
37 THREADSTATUS_WAIT_SLEEP, ///< Waiting due to a SleepThread SVC 37 THREADSTATUS_WAIT_SLEEP, ///< Waiting due to a SleepThread SVC
38 THREADSTATUS_WAIT_SYNCH, ///< Waiting due to a WaitSynchronization SVC 38 THREADSTATUS_WAIT_SYNCH_ANY, ///< Waiting due to WaitSynch1 or WaitSynchN with wait_all = false
39 THREADSTATUS_DORMANT, ///< Created but not yet made ready 39 THREADSTATUS_WAIT_SYNCH_ALL, ///< Waiting due to WaitSynchronizationN with wait_all = true
40 THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated 40 THREADSTATUS_DORMANT, ///< Created but not yet made ready
41 THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated
41}; 42};
42 43
43namespace Kernel { 44namespace Kernel {
@@ -158,10 +159,10 @@ public:
158 /** 159 /**
159 * Returns whether this thread is waiting for all the objects in 160 * Returns whether this thread is waiting for all the objects in
160 * its wait list to become ready, as a result of a WaitSynchronizationN call 161 * its wait list to become ready, as a result of a WaitSynchronizationN call
161 * with wait_all = true, or a ReplyAndReceive call. 162 * with wait_all = true.
162 */ 163 */
163 bool IsSleepingOnWaitAll() const { 164 bool IsSleepingOnWaitAll() const {
164 return !wait_objects.empty(); 165 return status == THREADSTATUS_WAIT_SYNCH_ALL;
165 } 166 }
166 167
167 ARM_Interface::ThreadContext context; 168 ARM_Interface::ThreadContext context;