Merge pull request #13594 from jordan-woyak/state-cleanups

State: Simplify interthread communication and general cleanups.
This commit is contained in:
Jordan Woyak
2026-02-03 16:50:52 -06:00
committed by GitHub
14 changed files with 581 additions and 373 deletions

View File

@@ -5,6 +5,8 @@
#include "Common/Logging/Log.h"
#include "Core/AchievementManager.h"
#include "UICommon/UICommon.h"
#include "jni/Host.h"
extern "C" {
@@ -18,4 +20,11 @@ Java_org_dolphinemu_dolphinemu_utils_ActivityTracker_setBackgroundExecutionAllow
INFO_LOG_FMT(CORE, "SetBackgroundExecutionAllowed {}", allowed);
AchievementManager::GetInstance().SetBackgroundExecutionAllowed(allowed);
}
JNIEXPORT void JNICALL
Java_org_dolphinemu_dolphinemu_utils_ActivityTracker_flushUnsavedData(JNIEnv*, jclass)
{
HostThreadLock guard;
UICommon::FlushUnsavedData();
}
}

View File

@@ -310,19 +310,17 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_eglBindAPI(J
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveState(JNIEnv*, jclass,
jint slot,
jboolean wait)
jint slot)
{
HostThreadLock guard;
State::Save(Core::System::GetInstance(), slot, wait);
State::Save(Core::System::GetInstance(), slot);
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SaveStateAs(JNIEnv* env, jclass,
jstring path,
jboolean wait)
jstring path)
{
HostThreadLock guard;
State::SaveAs(Core::System::GetInstance(), GetJString(env, path), wait);
State::SaveAs(Core::System::GetInstance(), GetJString(env, path));
}
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_LoadState(JNIEnv*, jclass,