State: Simplify interthread communication and cleanups. Save/Load calls are now always non-blocking for the caller, but appropriately block the CPU thread as needed.

This commit is contained in:
Jordan Woyak
2025-11-02 22:21:15 -06:00
parent 1d9e475123
commit 2322437f96
6 changed files with 328 additions and 374 deletions

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,