projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix snapshot code
[model-checker.git]
/
test
/
litmus
/
wrc.cc
diff --git
a/test/litmus/wrc.cc
b/test/litmus/wrc.cc
index 225eb4b2cbad2f2aadb6c9bd495debbbbf470124..7d295fe128cbc67eccd05464146745cd4405fae5 100644
(file)
--- a/
test/litmus/wrc.cc
+++ b/
test/litmus/wrc.cc
@@
-5,19
+5,23
@@
static int N = 2;
static int N = 2;
-std::atomic_int *x;
+/* Can be tested for different behavior with relaxed vs. release/acquire/seq-cst */
+#define load_mo std::memory_order_relaxed
+#define store_mo std::memory_order_relaxed
+
+static std::atomic_int *x;
static void a(void *obj)
{
int idx = *((int *)obj);
if (idx > 0)
static void a(void *obj)
{
int idx = *((int *)obj);
if (idx > 0)
- x[idx - 1].load(
std::memory_order_relaxed
);
+ x[idx - 1].load(
load_mo
);
if (idx < N)
if (idx < N)
- x[idx].store(1, st
d::memory_order_relaxed
);
+ x[idx].store(1, st
ore_mo
);
else
else
- x[0].load(
std::memory_order_relaxed
);
+ x[0].load(
load_mo
);
}
int user_main(int argc, char **argv)
}
int user_main(int argc, char **argv)