From 5059b85380595e538c40550184220f81a006f719 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 3 Mar 2025 15:13:21 -0500 Subject: [PATCH] kernel/condition_variable: Add a cpu_pause in the RemoveFromVariable loop. All the other spin-loops have this, so this loop should too. --- src/system/kernel/condition_variable.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system/kernel/condition_variable.cpp b/src/system/kernel/condition_variable.cpp index 1f870066bf..b68dad6062 100644 --- a/src/system/kernel/condition_variable.cpp +++ b/src/system/kernel/condition_variable.cpp @@ -147,6 +147,8 @@ ConditionVariableEntry::_RemoveFromVariable() // we do that, we may validly use our cached pointer to the variable. if (try_acquire_spinlock(&variable->fLock)) break; + + cpu_pause(); } // We now hold the variable's lock. Remove ourselves.