Skip to content

Commit

Permalink
Set thread name on AttachCurrentThread on Android.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Apr 24, 2023
1 parent 15f0099 commit 14e15d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Source/PS2VM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

#define LOG_NAME ("ps2vm")

#define THREAD_NAME ("PS2VM Thread")

#define STATE_VM_TIMING_XML ("vm_timing.xml")
#define STATE_VM_TIMING_VBLANK_TICKS ("vblankTicks")
#define STATE_VM_TIMING_IN_VBLANK ("inVblank")
Expand Down Expand Up @@ -251,7 +253,7 @@ void CPS2VM::Initialize()
{
m_nEnd = false;
m_thread = std::thread([&]() { EmuThread(); });
Framework::ThreadUtils::SetThreadName(m_thread, "PS2VM Thread");
Framework::ThreadUtils::SetThreadName(m_thread, THREAD_NAME);
}

void CPS2VM::Destroy()
Expand Down Expand Up @@ -815,7 +817,7 @@ void CPS2VM::EmuThread()
CProfiler::GetInstance().SetWorkThread();
#ifdef __ANDROID__
JNIEnv* env = nullptr;
Framework::CJavaVM::AttachCurrentThread(&env);
Framework::CJavaVM::AttachCurrentThread(&env, THREAD_NAME);
#endif
#ifdef PROFILE
CProfilerZone profilerZone(m_otherProfilerZone);
Expand Down
2 changes: 1 addition & 1 deletion deps/Framework

0 comments on commit 14e15d2

Please sign in to comment.