summaryrefslogtreecommitdiff
path: root/Source/Android/jni/Config/NativeConfig.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2023-11-25 13:43:04 +0100
committerJosJuice <josjuice@gmail.com>2023-11-25 14:06:29 +0100
commit5bda811a006e64e913c80c288a2171e6ca81b282 (patch)
tree95424886ae4aea97f1e27bfef1533cf1d6d3c490 /Source/Android/jni/Config/NativeConfig.cpp
parentf79c88f30b65a680f40cdc242205c315dba8d412 (diff)
Android: Remove HostThreadLocks that are no longer needed
71ce8bb6f00f4d1cbc1012270d6daefdbda4254d got rid of the need to be the host or CPU thread when writing to the config.
Diffstat (limited to 'Source/Android/jni/Config/NativeConfig.cpp')
-rw-r--r--Source/Android/jni/Config/NativeConfig.cpp11
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);
}
}