X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=6e765fd638ac982ea22d47944983cab90452b815;hb=affc0fb36f6a78cfe50cacd10b8a5c4d93011686;hp=4b380c2dd404fafc1b4be9846433967daa8cd167;hpb=90471233ff4dcca9a196152574dca4e7cf183698;p=cdsspec-compiler.git diff --git a/action.cc b/action.cc index 4b380c2..6e765fd 100644 --- a/action.cc +++ b/action.cc @@ -1,7 +1,6 @@ #include #define __STDC_FORMAT_MACROS #include -#include #include "model.h" #include "action.h" @@ -78,6 +77,11 @@ bool ModelAction::is_thread_start() const return type == THREAD_START; } +bool ModelAction::is_thread_join() const +{ + return type == THREAD_JOIN; +} + bool ModelAction::is_relseq_fixup() const { return type == MODEL_FIXUP_RELSEQ; @@ -604,7 +608,7 @@ void ModelAction::print() const if (idx >= 0) model_print(" Rf: P%-2d", idx); else - model_print(" RF: P? "); + model_print(" Rf: P? "); } else model_print(" Rf: ? "); } @@ -626,8 +630,13 @@ unsigned int ModelAction::hash() const hash ^= seq_number << 5; hash ^= id_to_int(tid) << 6; - if (is_read() && reads_from) - hash ^= reads_from->get_seq_number(); + if (is_read()) { + if (reads_from) + hash ^= reads_from->get_seq_number(); + else if (reads_from_promise) + hash ^= model->get_promise_number(reads_from_promise); + hash ^= get_reads_from_value(); + } return hash; }