Browse Source

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>
pull/88940/head
S Swetha 4 months ago committed by Benjamin Cabé
parent
commit
cbc5fdbb4b
  1. 4
      tests/kernel/spinlock/src/main.c

4
tests/kernel/spinlock/src/main.c

@ -83,7 +83,7 @@ static void bounce_once(int id, bool trylock) @@ -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) @@ -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 */

Loading…
Cancel
Save