X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=seqlock%2Fseqlock-wildcard.h;h=c7d0634e3b5a763fd234f5963f29beba7500f914;hb=b684f62b7411fea476b2e1f6a8bbf920ac4c7216;hp=62b7583954bd446a4c224030117712321d5ff369;hpb=f8c46d903b303b81ef0d25cb8495de22d299466b;p=model-checker-benchmarks.git diff --git a/seqlock/seqlock-wildcard.h b/seqlock/seqlock-wildcard.h index 62b7583..c7d0634 100644 --- a/seqlock/seqlock-wildcard.h +++ b/seqlock/seqlock-wildcard.h @@ -27,14 +27,14 @@ typedef struct seqlock { } void write(int new_data) { - int old_seq = _seq.load(wildcard(4)); // acquire 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, - wildcard(5), wildcard(6))) // relaxed + wildcard(5), wildcard(6))) // relaxed break; }