1 Star 0 Fork 7

k18700474961/OS kernel test

forked from laokz/OS kernel test 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
samelockorder.litmus 543 Bytes
一键复制 编辑 原始数据 按行查看 历史
laokz 提交于 2020-08-20 22:32 . fix linux mapping comment
C based-on-ISA2+pooncelock+pooncelock+pombonce.litmus
(*
* Result: Sometimes
*
* This test shows that two critical section protected by same lock
* on same cpu DO NOT enforce ordering to external process!
* This is likely to change soon.
*)
{}
P0(int *x, int *y, spinlock_t *mylock)
{
spin_lock(mylock);
WRITE_ONCE(*x, 1);
spin_unlock(mylock);
spin_lock(mylock);
WRITE_ONCE(*y, 1);
spin_unlock(mylock);
}
P1(int *x, int *y)
{
int r1;
int r2;
r2 = READ_ONCE(*y);
smp_mb();
r1 = READ_ONCE(*x);
}
exists (1:r2=1 /\ 1:r1=0)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/k18700474961/OS-kernel-test.git
git@gitee.com:k18700474961/OS-kernel-test.git
k18700474961
OS-kernel-test
OS kernel test
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385