#include "action.h"
#include "clockvector.h"
#include "common.h"
-#include "threads.h"
+#include "threads-model.h"
+#include "nodestack.h"
#define ACTION_INITIAL_CLOCK 0
location(loc),
value(value),
reads_from(NULL),
+ node(NULL),
seq_number(ACTION_INITIAL_CLOCK),
- cv(NULL)
+ cv(NULL),
+ sleep_flag(false)
{
Thread *t = thread ? thread : thread_current();
this->tid = t->get_id();
} 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;
+}