summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/thread.cpp16
-rw-r--r--src/core/hle/kernel/thread.h3
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 7b4f0ea47..af9188faa 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -200,8 +200,15 @@ Thread* __NextThread() {
200 return Kernel::g_object_pool.GetFast<Thread>(next); 200 return Kernel::g_object_pool.GetFast<Thread>(next);
201} 201}
202 202
203/// Puts a thread in the wait state for the given type/reason
204void __WaitCurThread(WaitType wait_type, const char* reason) {
205 Thread* t = __GetCurrentThread();
206 t->wait_type = wait_type;
207 __ChangeThreadState(t, ThreadStatus(THREADSTATUS_WAIT | (t->status & THREADSTATUS_SUSPEND)));
208}
209
203/// Resumes a thread from waiting by marking it as "ready" 210/// Resumes a thread from waiting by marking it as "ready"
204void __ResumeThreadFromWait(Handle handle) { 211void ResumeThreadFromWait(Handle handle) {
205 u32 error; 212 u32 error;
206 Thread* t = Kernel::g_object_pool.Get<Thread>(handle, error); 213 Thread* t = Kernel::g_object_pool.Get<Thread>(handle, error);
207 if (t) { 214 if (t) {
@@ -212,13 +219,6 @@ void __ResumeThreadFromWait(Handle handle) {
212 } 219 }
213} 220}
214 221
215/// Puts a thread in the wait state for the given type/reason
216void __WaitCurThread(WaitType wait_type, const char* reason) {
217 Thread* t = __GetCurrentThread();
218 t->wait_type = wait_type;
219 __ChangeThreadState(t, ThreadStatus(THREADSTATUS_WAIT | (t->status & THREADSTATUS_SUSPEND)));
220}
221
222/// Creates a new thread 222/// Creates a new thread
223Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority, 223Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority,
224 s32 processor_id, u32 stack_top, int stack_size) { 224 s32 processor_id, u32 stack_top, int stack_size) {
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 2c0199273..bb48ddc79 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -31,6 +31,9 @@ Handle SetupMainThread(s32 priority, int stack_size=Kernel::DEFAULT_STACK_SIZE);
31/// Reschedules to the next available thread (call after current thread is suspended) 31/// Reschedules to the next available thread (call after current thread is suspended)
32void Reschedule(const char* reason); 32void Reschedule(const char* reason);
33 33
34/// Resumes a thread from waiting by marking it as "ready"
35void ResumeThreadFromWait(Handle handle);
36
34/// Gets the current thread 37/// Gets the current thread
35Handle GetCurrentThread(); 38Handle GetCurrentThread();
36 39