Make mutex between writers really atomic. Fixes the two flips run.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
rm -f .input.spin.trail
spin -a -X .input.spin
gcc -w ${CFLAGS} -DSAFETY -o pan pan.c
- ./pan -v -c1 -X -m10000 -w19
+ ./pan -v -c1 -X -m10000 -w20
cp .input.spin $@.spin.input
-cp .input.spin.trail $@.spin.input.trail
spin -f "!(`cat urcu_free.ltl | grep -v ^//`)" >> pan.ltl
run: pan
- ./pan -a -v -c1 -X -m10000 -w19
+ ./pan -a -v -c1 -X -m10000 -w20
pan: pan.c
gcc -w ${CFLAGS} -o pan pan.c
ooo_mem(i);
do
- :: write_lock == 0 ->
- write_lock = 1;
- break;
- :: else ->
- skip;
+ :: 1 ->
+ atomic {
+ if
+ :: write_lock == 0 ->
+ write_lock = 1;
+ break;
+ :: else ->
+ skip;
+ fi;
+ }
od;
smp_mb(i);
ooo_mem(i);
#endif
ooo_mem(i);
smp_mb(i);
- /* free-up step, e.g., kfree(). */
ooo_mem(i);
+ write_lock = 0;
+ /* free-up step, e.g., kfree(). */
atomic {
last_free_gen = old_gen;
free_done = 1;
- write_lock = 0;
}
}