Skip to content

Commit cbc5fdb

Browse files
sswetha18kartben
authored andcommitted
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 <[email protected]>
1 parent c09ec58 commit cbc5fdb

File tree

1 file changed

+2
-2
lines changed
  • tests/kernel/spinlock/src

1 file changed

+2
-2
lines changed

tests/kernel/spinlock/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static void bounce_once(int id, bool trylock)
8383
}
8484

8585
k_spin_unlock(&bounce_lock, key);
86-
k_busy_wait(100);
86+
k_busy_wait(1);
8787
}
8888

8989
if (!locked && bounce_done) {
@@ -99,7 +99,7 @@ static void bounce_once(int id, bool trylock)
9999

100100
for (i = 0; i < 5; i++) {
101101
zassert_true(bounce_owner == id, "Locked data changed");
102-
k_busy_wait(1);
102+
k_busy_wait(5);
103103
}
104104

105105
/* Release the lock */

0 commit comments

Comments
 (0)