diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-11-26 22:56:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-26 22:56:55 +0100 |
| commit | 10e2ad305d9c38fef8547a5390525800dc0e7691 (patch) | |
| tree | 65770fbdf899b12d4a8366855cc317904568df37 /Source/Android/jni/Config/NativeConfig.cpp | |
| parent | 8a19be6052d31c31c875d504bb7501396875b7a7 (diff) | |
| parent | 5bda811a006e64e913c80c288a2171e6ca81b282 (diff) | |
Merge pull request #12316 from JosJuice/android-less-host-thread-lock
Android: Remove HostThreadLocks that are no longer needed
Diffstat (limited to 'Source/Android/jni/Config/NativeConfig.cpp')
| -rw-r--r-- | Source/Android/jni/Config/NativeConfig.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/Android/jni/Config/NativeConfig.cpp b/Source/Android/jni/Config/NativeConfig.cpp index f8b9397930..f367c5e162 100644 --- a/Source/Android/jni/Config/NativeConfig.cpp +++ b/Source/Android/jni/Config/NativeConfig.cpp @@ -123,7 +123,6 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_loadGameInis jstring jGameId, jint jRevision) { - HostThreadLock guard; const std::string game_id = GetJString(env, jGameId); const u16 revision = static_cast<u16>(jRevision); Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision)); @@ -133,7 +132,6 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_loadGameInis JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameInis(JNIEnv*, jclass) { - HostThreadLock guard; Config::RemoveLayer(Config::LayerType::GlobalGame); Config::RemoveLayer(Config::LayerType::LocalGame); } @@ -141,7 +139,10 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameIn JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_save( JNIEnv*, jclass, jint layer) { + // HostThreadLock is used to ensure we don't try to save to SYSCONF at the same time as + // emulation shutdown does HostThreadLock guard; + return GetLayer(layer, {})->Save(); } @@ -149,7 +150,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteAllKeys(JNIEnv*, jclass, jint layer) { - HostThreadLock guard; return GetLayer(layer, {})->DeleteAllKeys(); } @@ -166,7 +166,6 @@ JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteKey( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key) { - HostThreadLock guard; const Config::Location location = GetLocation(env, file, section, key); const bool had_value = GetLayer(layer, location)->DeleteKey(location); if (had_value) @@ -220,7 +219,6 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setString( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jstring value) { - HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), GetJString(env, value)); } @@ -228,21 +226,18 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setBoolean( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jboolean value) { - HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), static_cast<bool>(value)); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setInt( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jint value) { - HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), value); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_setFloat( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, jfloat value) { - HostThreadLock guard; return Set(layer, GetLocation(env, file, section, key), value); } } |
