X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=5e050810e7526408828b27c74cad76fcdef95a4b;hb=2e9b955070a194963ddb98a5cb3e16968323adec;hp=b7bf024a4e79447220bfb50cd5268413e474f9b3;hpb=b6f06ab2c626eb6e0f044fa9c7d1b74fbc82a09d;p=model-checker.git diff --git a/action.cc b/action.cc index b7bf024..5e05081 100644 --- a/action.cc +++ b/action.cc @@ -7,7 +7,7 @@ #include "action.h" #include "clockvector.h" #include "common.h" -#include "threads.h" +#include "threads-model.h" #include "nodestack.h" #define ACTION_INITIAL_CLOCK 0 @@ -415,3 +415,18 @@ void ModelAction::print() const } else printf("\n"); } + +/** @brief Print nicely-formatted info about this ModelAction */ +unsigned int ModelAction::hash() const +{ + unsigned int hash=(unsigned int) this->type; + hash^=((unsigned int)this->order)<<3; + hash^=seq_number<<5; + hash^=tid<<6; + + if (is_read()) { + if (reads_from) + hash^=reads_from->get_seq_number(); + } + return hash; +}