tests: kernel: spinlock: Increase lock contention

This commit resolves lock contention
issues by increasing the probablity of
contention during the test execution.

Increased wait delay when lock is taken
and Reduced wait delay when the lock is
released.

Achieved 99% lock contention probablity,
verified through runtime metrices.

Signed-off-by: S Swetha <s.swetha@intel.com>
This commit is contained in:
S Swetha 2025-03-21 00:49:56 +05:30 committed by Benjamin Cabé
commit cbc5fdbb4b

View file

@ -83,7 +83,7 @@ static void bounce_once(int id, bool trylock)
}
k_spin_unlock(&bounce_lock, key);
k_busy_wait(100);
k_busy_wait(1);
}
if (!locked && bounce_done) {
@ -99,7 +99,7 @@ static void bounce_once(int id, bool trylock)
for (i = 0; i < 5; i++) {
zassert_true(bounce_owner == id, "Locked data changed");
k_busy_wait(1);
k_busy_wait(5);
}
/* Release the lock */