projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
668f992
)
userprog: print atomic load/store values
author
Brian Norris
<banorris@uci.edu>
Thu, 26 Apr 2012 23:15:31 +0000
(16:15 -0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 26 Apr 2012 23:15:31 +0000
(16:15 -0700)
userprog.c
patch
|
blob
|
history
diff --git
a/userprog.c
b/userprog.c
index 4b106d88c11e8f0829008b5d7c47dd626e093c05..bab9f982a614c209c37acd84a06f41ffe061b35b 100644
(file)
--- a/
userprog.c
+++ b/
userprog.c
@@
-6,15
+6,18
@@
static void a(atomic_int *obj)
{
int i;
+ int ret;
for (i = 0; i < 10; i++) {
printf("Thread %d, loop %d\n", thrd_current(), i);
switch (i % 4) {
case 1:
- atomic_load(obj);
+ ret = atomic_load(obj);
+ printf("Read value: %d\n", ret);
break;
case 3:
atomic_store(obj, i);
+ printf("Write value: %d\n", i);
break;
}
}