diff options
| author | JosJuice <josjuice@gmail.com> | 2023-06-11 13:00:52 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2023-06-12 23:39:42 +0200 |
| commit | 03f2f57edf7ac7340b25c4d603b721ab6910359c (patch) | |
| tree | e9409d40a4756991b6d72ff3443507ff57563a57 /Source/Android/jni/MainAndroid.cpp | |
| parent | 3519a7070d5dc476cb1911bb1d2b05befbe0804b (diff) | |
Android: Add HostThreadLock where necessary
Diffstat (limited to 'Source/Android/jni/MainAndroid.cpp')
| -rw-r--r-- | Source/Android/jni/MainAndroid.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 0b8a0760ab..90e56822f4 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -489,12 +489,14 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimo JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReloadConfig(JNIEnv*, jclass) { + HostThreadLock guard; SConfig::GetInstance().LoadSettings(); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UpdateGCAdapterScanThread(JNIEnv*, jclass) { + HostThreadLock guard; if (GCAdapter::UseAdapter()) { GCAdapter::StartScanThread(); @@ -507,6 +509,9 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_UpdateGCAdapterScanThread(JNIEnv*, JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Initialize(JNIEnv*, jclass) { + // InitControllers ends up calling config code, and some config callbacks use RunAsCPUThread + HostThreadLock guard; + UICommon::CreateDirectories(); Common::RegisterMsgAlertHandler(&MsgAlert); Common::AndroidSetReportHandler(&ReportSend); @@ -621,6 +626,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RunSystemMen JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ChangeDisc(JNIEnv* env, jclass, jstring jFile) { + HostThreadLock guard; const std::string path = GetJString(env, jFile); __android_log_print(ANDROID_LOG_INFO, DOLPHIN_TAG, "Change Disc: %s", path.c_str()); Core::RunAsCPUThread([&path] { Core::System::GetInstance().GetDVDInterface().ChangeDisc(path); }); |
