projects
/
model-checker-benchmarks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add another testcase for dekker-fences
[model-checker-benchmarks.git]
/
seqlock
/
seqlock-wildcard.h
diff --git
a/seqlock/seqlock-wildcard.h
b/seqlock/seqlock-wildcard.h
index 62b7583954bd446a4c224030117712321d5ff369..c7d0634e3b5a763fd234f5963f29beba7500f914 100644
(file)
--- a/
seqlock/seqlock-wildcard.h
+++ b/
seqlock/seqlock-wildcard.h
@@
-27,14
+27,14
@@
typedef struct seqlock {
}
void write(int new_data) {
}
void write(int new_data) {
- int old_seq = _seq.load(wildcard(4)); // acquire
while (true) {
while (true) {
+ int old_seq = _seq.load(wildcard(4)); // acquire
if (old_seq % 2 == 1)
continue; // Retry
// Should be relaxed!!!
if (_seq.compare_exchange_strong(old_seq, old_seq + 1,
if (old_seq % 2 == 1)
continue; // Retry
// Should be relaxed!!!
if (_seq.compare_exchange_strong(old_seq, old_seq + 1,
- wildcard(5), wildcard(6))) // relaxed
+ wildcard(5), wildcard(6))) // relaxed
break;
}
break;
}