Remove xenia-cpu dependency on xenia-kernel

This commit is contained in:
Dr. Chat
2017-02-06 21:04:00 -06:00
parent b66f10f2b8
commit 4c55039c22
9 changed files with 130 additions and 57 deletions

29
src/xenia/cpu/thread.cc Normal file
View File

@@ -0,0 +1,29 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2017 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/cpu/thread.h"
#include "xenia/cpu/thread_state.h"
namespace xe {
namespace cpu {
thread_local Thread* Thread::current_thread_tls_ = nullptr;
Thread::Thread() {}
Thread::~Thread() {}
bool Thread::IsInThread() { return current_thread_tls_ != nullptr; }
Thread* Thread::GetCurrentThread() { return current_thread_tls_; }
uint32_t Thread::GetCurrentThreadId() {
return Thread::GetCurrentThread()->thread_state()->thread_id();
}
} // namespace cpu
} // namespace xe