From 3519a7070d5dc476cb1911bb1d2b05befbe0804b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 11 Jun 2023 12:18:16 +0200 Subject: Android: And Lock and Unlock wrappers to HostThreadLock This way we can ensure DeclareAsHostThread and UndeclareAsHostThread are called when locking and unlocking. --- Source/Android/jni/MainAndroid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index d99326aaae..0b8a0760ab 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -447,9 +447,9 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestr while (s_is_booting.IsSet()) { // Need to wait for boot to finish before we can pause - host_identity_guard.m_lock.unlock(); + host_identity_guard.Unlock(); std::this_thread::sleep_for(std::chrono::milliseconds(1)); - host_identity_guard.m_lock.lock(); + host_identity_guard.Lock(); } if (Core::GetState() == Core::State::Running) @@ -572,15 +572,15 @@ static void Run(JNIEnv* env, std::unique_ptr&& boot, bool riivol while (Core::IsRunning()) { - host_identity_guard.m_lock.unlock(); + host_identity_guard.Unlock(); s_update_main_frame_event.Wait(); - host_identity_guard.m_lock.lock(); + host_identity_guard.Lock(); Core::HostDispatchJobs(); } s_game_metadata_is_valid = false; Core::Shutdown(); - host_identity_guard.m_lock.unlock(); + host_identity_guard.Unlock(); env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetFinishEmulationActivity()); -- cgit v1.2.3