projects
/
model-checker-benchmarks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fca1681
)
mcs-lock: add more locking tests to driver
author
Brian Norris
<banorris@uci.edu>
Thu, 1 Nov 2012 19:21:22 +0000
(12:21 -0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 1 Nov 2012 19:21:22 +0000
(12:21 -0700)
mcs-lock/mcs-lock.cc
patch
|
blob
|
history
diff --git
a/mcs-lock/mcs-lock.cc
b/mcs-lock/mcs-lock.cc
index 26e5a27edb76da058cc352eabd5c300a8fdb0ca8..ec0cc5df9d55c904d3a5cf9a677f42488371a7bb 100644
(file)
--- a/
mcs-lock/mcs-lock.cc
+++ b/
mcs-lock/mcs-lock.cc
@@
-14,12
+14,19
@@
void threadA(void *arg)
mcs_mutex::guard g(mutex);
printf("store: %d\n", 17);
store_32(&shared, 17);
+ mutex->unlock(&g);
+ mutex->lock(&g);
+ printf("load: %u\n", load_32(&shared));
}
void threadB(void *arg)
{
mcs_mutex::guard g(mutex);
printf("load: %u\n", load_32(&shared));
+ mutex->unlock(&g);
+ mutex->lock(&g);
+ printf("store: %d\n", 17);
+ store_32(&shared, 17);
}
int user_main(int argc, char **argv)