summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/kernel.cpp3
-rw-r--r--src/core/hle/kernel/kernel.h1
-rw-r--r--src/core/hle/kernel/thread.cpp6
3 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index de80de893..c0c0fa177 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -14,6 +14,7 @@
namespace Kernel {
+Handle g_main_thread = 0;
ObjectPool g_object_pool;
ObjectPool::ObjectPool() {
@@ -150,7 +151,7 @@ bool LoadExec(u32 entry_point) {
Core::g_app_core->SetPC(entry_point);
// 0x30 is the typical main thread priority I've seen used so far
- Handle thread = Kernel::SetupMainThread(0x30);
+ g_main_thread = Kernel::SetupMainThread(THREADPRIO_DEFAULT);
return true;
}
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 620cd2d73..2192df16f 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -163,6 +163,7 @@ private:
};
extern ObjectPool g_object_pool;
+extern Handle g_main_thread;
/**
* Loads executable stored at specified address
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index d1e13c949..f2094f7a7 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -285,11 +285,11 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
HLE::EatCycles(32000);
+ CallThread(t);
+
// This won't schedule to the new thread, but it may to one woken from eating cycles.
// Technically, this should not eat all at once, and reschedule in the middle, but that's hard.
- HLE::ReSchedule("thread created");
-
- CallThread(t);
+ //HLE::Reschedule("thread created");
return handle;
}