Skip to content
Commit 26508027 authored by Huifeng Zhang's avatar Huifeng Zhang Committed by Stephanos Ioannidis
Browse files

tests: kernel: semaphore: fix mutual exclusion test issue



Mutual exclusion test assume that the excution order of two threads like
this:
    mutual_exclusion1 -> mutual_exclusion2 -> mutual_exclusion1 ...

but some times the excution order of two threads would be this:
    mutual_exclusion1 -> mutual_exclusion2 -> mutual_exclusion2 ...

This patch increase the loop cycle, add a variable 'tmp' to store the
value of 'critical_var' before operating it.

Signed-off-by: default avatarHuifeng Zhang <Huifeng.Zhang@arm.com>
parent 3ca07c01
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment