#include "model.h"
#include "action.h"
#include "clockvector.h"
+#include "common.h"
ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)
{
return false;
}
+void ModelAction::create_cv(ModelAction *parent)
+{
+ ASSERT(cv == NULL);
+ if (parent)
+ cv = new ClockVector(parent->cv, this);
+ else
+ cv = new ClockVector();
+}
+
+void ModelAction::read_from(ModelAction *act)
+{
+ ASSERT(cv);
+ if (act->is_release() && this->is_acquire())
+ cv->merge(act->cv);
+ value = act->value;
+}
+
void ModelAction::print(void)
{
const char *type_str;