projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into brian
[model-checker.git]
/
action.cc
diff --git
a/action.cc
b/action.cc
index d9aae2d4958253977e9f0256fb87076174e94a67..39b0f7f6d4847207f0dc2a18da5b0edeffa5776a 100644
(file)
--- a/
action.cc
+++ b/
action.cc
@@
-10,6
+10,7
@@
ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int
order(order),
location(loc),
value(value),
order(order),
location(loc),
value(value),
+ reads_from(NULL),
cv(NULL)
{
Thread *t = thread_current();
cv(NULL)
{
Thread *t = thread_current();
@@
-132,6
+133,7
@@
void ModelAction::read_from(const ModelAction *act)
ASSERT(cv);
if (act->is_release() && this->is_acquire())
cv->merge(act->cv);
ASSERT(cv);
if (act->is_release() && this->is_acquire())
cv->merge(act->cv);
+ reads_from = act;
value = act->value;
}
value = act->value;
}
@@
-178,8
+180,10
@@
void ModelAction::print(void) const
type_str = "unknown type";
}
type_str = "unknown type";
}
- printf("(%3d) Thread: %-2d Action: %-13s MO: %d Loc: %14p Value: %d",
+ printf("(%3d) Thread: %-2d Action: %-13s MO: %d Loc: %14p Value: %
-4
d",
seq_number, id_to_int(tid), type_str, order, location, value);
seq_number, id_to_int(tid), type_str, order, location, value);
+ if (reads_from)
+ printf(" Rf: %d", reads_from->get_seq_number());
if (cv) {
printf("\t");
cv->print();
if (cv) {
printf("\t");
cv->print();