X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=205bedbf6f12806835a503975e95709162630070;hb=9a416eb64865be1728786eb65b1c4b995cfa194d;hp=5124780cec727982621a8c7e698f753bf7371e31;hpb=45d8b1a74beaf6a80ce44a1f9aa3d59abc5d0582;p=c11tester.git diff --git a/action.cc b/action.cc index 5124780c..205bedbf 100644 --- a/action.cc +++ b/action.cc @@ -1,6 +1,7 @@ #include #define __STDC_FORMAT_MACROS #include +#include #include "model.h" #include "action.h" @@ -166,8 +167,11 @@ void ModelAction::read_from(const ModelAction *act) { ASSERT(cv); reads_from = act; - if (act!=NULL && act->is_release() && this->is_acquire()) { - synchronize_with(act); + if (act != NULL && this->is_acquire()) { + std::vector release_heads; + model->get_release_seq_heads(this, &release_heads); + for (unsigned int i = 0; i < release_heads.size(); i++) + synchronize_with(release_heads[i]); } } @@ -182,6 +186,11 @@ void ModelAction::synchronize_with(const ModelAction *act) { cv->merge(act->cv); } +bool ModelAction::has_synchronized_with(const ModelAction *act) const +{ + return cv->has_synchronized_with(act->cv); +} + /** * Check whether 'this' happens before act, according to the memory-model's * happens before relation. This is checked via the ClockVector constructs. @@ -209,6 +218,9 @@ void ModelAction::print(void) const case THREAD_JOIN: type_str = "thread join"; break; + case THREAD_FINISH: + type_str = "thread finish"; + break; case ATOMIC_READ: type_str = "atomic read"; break; @@ -256,8 +268,12 @@ void ModelAction::print(void) const printf("(%3d) Thread: %-2d Action: %-13s MO: %7s Loc: %14p Value: %-12" PRIu64, seq_number, id_to_int(tid), type_str, mo_str, location, valuetoprint); - if (reads_from) - printf(" Rf: %d", reads_from->get_seq_number()); + if (is_read()) { + if (reads_from) + printf(" Rf: %d", reads_from->get_seq_number()); + else + printf(" Rf: ?"); + } if (cv) { printf("\t"); cv->print();