KConditionVariable/KAddressArbiter: no need for global compare thread

This commit is contained in:
Michael Scire authored and SciresM committed 2020-12-02 06:43:37 -08:00
1 parent 550f5690bf
commit c8ebd7eea0
6 files changed
+124 -23

No files matched your search

@@ -17,8 +17,6 @@
namespace ams::kern {
constinit KThread g_cv_arbiter_compare_thread;
namespace {
ALWAYS_INLINE bool ReadFromUser(u32 *out, KProcessAddress address) {
@@ -179,9 +177,8 @@ namespace ams::kern {
int num_waiters = 0;
{
KScopedSchedulerLock sl;
g_cv_arbiter_compare_thread.SetupForConditionVariableCompare(cv_key, -1);
auto it = this->tree.nfind(g_cv_arbiter_compare_thread);
auto it = this->tree.nfind_light({ cv_key, -1 });
while ((it != this->tree.end()) && (count <= 0 || num_waiters < count) && (it->GetConditionVariableKey() == cv_key)) {
KThread *target_thread = std::addressof(*it);