From 068947e2b613d15f724c87c501949c9105cc7f7f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 19 May 2025 12:08:10 +0200 Subject: Core: Remove IsHostThread The core no longer cares which thread is the host thread. Cleaning up Android's HostThreadLock is left for another PR, in part because the HostThreadLock in NativeConfig.cpp still serves a purpose, and in part to make any issues easier to bisect. --- Source/Android/jni/Host.h | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'Source/Android') diff --git a/Source/Android/jni/Host.h b/Source/Android/jni/Host.h index 3a7a304825..0183038d9a 100644 --- a/Source/Android/jni/Host.h +++ b/Source/Android/jni/Host.h @@ -5,37 +5,24 @@ #include -#include "Core/Core.h" - // The Core only supports using a single Host thread. // If multiple threads want to call host functions then they need to queue // sequentially for access. +// TODO: The above isn't true anymore, so we should get rid of this class. struct HostThreadLock { - explicit HostThreadLock() : m_lock(s_host_identity_mutex) { Core::DeclareAsHostThread(); } + explicit HostThreadLock() : m_lock(s_host_identity_mutex) {} - ~HostThreadLock() - { - if (m_lock.owns_lock()) - Core::UndeclareAsHostThread(); - } + ~HostThreadLock() = default; HostThreadLock(const HostThreadLock& other) = delete; HostThreadLock(HostThreadLock&& other) = delete; HostThreadLock& operator=(const HostThreadLock& other) = delete; HostThreadLock& operator=(HostThreadLock&& other) = delete; - void Lock() - { - m_lock.lock(); - Core::DeclareAsHostThread(); - } - - void Unlock() - { - m_lock.unlock(); - Core::UndeclareAsHostThread(); - } + void Lock() { m_lock.lock(); } + + void Unlock() { m_lock.unlock(); } private: static std::mutex s_host_identity_mutex; -- cgit v1.2.3