brintos

brintos / linux-shallow public Read only

0
0
Text · 357 B · ffd4d3e Raw
26 lines · plain
1C Atomic-RMW-ops-are-atomic-WRT-atomic_set2 3(*4 * Result: Never5 *6 * Test that atomic_set() cannot break the atomicity of atomic RMWs.7 * NOTE: This requires herd7 7.56 or later which supports "(void)expr".8 *)9 10{11	atomic_t v = ATOMIC_INIT(1);12}13 14P0(atomic_t *v)15{16	(void)atomic_add_unless(v, 1, 0);17}18 19P1(atomic_t *v)20{21	atomic_set(v, 0);22}23 24exists25(v=2)26