This interface provides a wrapper for all our model checking operations on the
current action (at least, ideally this should work...I might need to work on
this a bit).
For now, we just record the program trace of all atomic/thread actions.
#include "model.h"
#include "schedule.h"
+#include "common.h"
ModelChecker *model;
this->system_thread = t;
}
+void ModelChecker::check_current_action(void)
+{
+ if (this->current_action)
+ this->action_trace.push_back(this->current_action);
+ else
+ DEBUG("trying to push NULL action...\n");
+}
+
ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, int value)
{
struct thread *t = thread_current();
#ifndef __MODEL_H__
#define __MODEL_H__
+#include <list>
+
#include "schedule.h"
#include "libthreads.h"
#include "libatomic.h"
void assign_id(struct thread *t);
void set_current_action(ModelAction *act) { current_action = act; }
+ void check_current_action(void);
private:
int used_thread_id;
class ModelAction *current_action;
+ std::list<class ModelAction *> action_trace;
};
extern ModelChecker *model;