Skip to content

Commit a3959af

Browse files
finikorgcarlescufi
authored andcommitted
tests: spinlock: Increase thread execution to prevent quick exit
On Intel boards (like intel_ehl_crb and intel_rpl_s_crb) for the trylock_test some part is executed very fast and since there is no synchronization, there might be situation when there is no trylock_failures. Increasing time spend in this part fixes the issue. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 2b92598 commit a3959af

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

tests/kernel/spinlock/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ void bounce_once(int id, bool trylock)
9797
*/
9898
bounce_owner = id;
9999

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

104105
/* Release the lock */

0 commit comments

Comments
 (0)