mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
vm::var improved, cleanup
Mostly vm::var initialization introduced. Added vm::make_var function.
This commit is contained in:
parent
cc02a147d3
commit
a974ee009e
116 changed files with 2763 additions and 3019 deletions
|
@ -8,6 +8,8 @@
|
|||
#include "CPUDecoder.h"
|
||||
#include "CPUThread.h"
|
||||
|
||||
thread_local CPUThread* g_tls_current_cpu_thread = nullptr;
|
||||
|
||||
CPUThread::CPUThread(CPUThreadType type, const std::string& name, std::function<std::string()> thread_name)
|
||||
: m_id(idm::get_last_id())
|
||||
, m_type(type)
|
||||
|
@ -15,6 +17,8 @@ CPUThread::CPUThread(CPUThreadType type, const std::string& name, std::function<
|
|||
{
|
||||
start(std::move(thread_name), [this]
|
||||
{
|
||||
g_tls_current_cpu_thread = this;
|
||||
|
||||
Emu.SendDbgCommand(DID_CREATE_THREAD, this);
|
||||
|
||||
std::unique_lock<std::mutex> lock(mutex);
|
||||
|
@ -197,13 +201,13 @@ void CPUThread::sleep()
|
|||
|
||||
void CPUThread::awake()
|
||||
{
|
||||
// must be called after the balanced Sleep() call
|
||||
// must be called after the balanced sleep() call
|
||||
|
||||
if (m_state.atomic_op([](u64& state) -> bool
|
||||
{
|
||||
if (state < CPU_STATE_MAX)
|
||||
{
|
||||
throw EXCEPTION("Sleep()/Awake() inconsistency");
|
||||
throw EXCEPTION("sleep()/awake() inconsistency");
|
||||
}
|
||||
|
||||
if ((state -= CPU_STATE_MAX) < CPU_STATE_MAX)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue