From b62c25864f6d549976b94eda60763524413e896e Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 17 Aug 2023 09:15:09 +0200 Subject: [PATCH] CPUThreadConfigCallback: Remove some CPU thread asserts Turns out that we have two subsystems that want to register CPU thread callbacks from a different thread than the CPU thread: FreeLookConfig and VideoConfig. Both seem to happen from the host thread before the CPU thread starts, so there's no thread safety issue. But ideally, if we want to allow registering callbacks from threads other than the CPU thread, we should make registering callbacks actually thread-safe. This is an unsolved problem for the regular Config system, so I would like to leave it outside the scope of this PR. --- Source/Core/Core/CPUThreadConfigCallback.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Core/Core/CPUThreadConfigCallback.cpp b/Source/Core/Core/CPUThreadConfigCallback.cpp index 857ba24189..a5b619f27a 100644 --- a/Source/Core/Core/CPUThreadConfigCallback.cpp +++ b/Source/Core/Core/CPUThreadConfigCallback.cpp @@ -44,8 +44,6 @@ namespace CPUThreadConfigCallback { ConfigChangedCallbackID AddConfigChangedCallback(Config::ConfigChangedCallback func) { - DEBUG_ASSERT(Core::IsCPUThread()); - static auto s_config_changed_callback_id = Config::AddConfigChangedCallback(&OnConfigChanged); const ConfigChangedCallbackID callback_id{s_next_callback_id}; @@ -56,8 +54,6 @@ ConfigChangedCallbackID AddConfigChangedCallback(Config::ConfigChangedCallback f void RemoveConfigChangedCallback(ConfigChangedCallbackID callback_id) { - DEBUG_ASSERT(Core::IsCPUThread()); - for (auto it = s_callbacks.begin(); it != s_callbacks.end(); ++it) { if (it->first == callback_id)