Kernel: Properly initialize and shutdown all modules.

This commit is contained in:
bunnei committed 2015-05-01 18:27:03 -04:00
1 parent 57aaaf92db
commit c7dc799e19
4 files changed
+20 -9

No files matched your search

+8 -2
View File
@@ -23,7 +23,7 @@
namespace Kernel {
/// Event type for the thread wake up event
static int ThreadWakeupEventType = -1;
static int ThreadWakeupEventType;
bool Thread::ShouldWait() {
return status != THREADSTATUS_DEAD;
@@ -42,7 +42,7 @@ static Common::ThreadQueueList<Thread*, THREADPRIO_LOWEST+1> ready_queue;
static Thread* current_thread;
// The first available thread id at startup
static u32 next_thread_id = 1;
static u32 next_thread_id;
/**
* Creates a new thread ID
@@ -497,6 +497,12 @@ void Thread::SetWaitSynchronizationOutput(s32 output) {
void ThreadingInit() {
ThreadWakeupEventType = CoreTiming::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback);
current_thread = nullptr;
next_thread_id = 1;
thread_list.clear();
ready_queue.clear();
// Setup the idle thread
SetupIdleThread();
}