X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=execution.h;h=12603b2fcb49bcf8555982aa09b02d2756925195;hb=29de97f281defdf0c79ef4afc5abf88b430d3864;hp=9ae0b4f3e6b3f67d578562f07522742493894ef2;hpb=a22d12cff31e5309eb0033324d3dd0258de53cb5;p=model-checker.git diff --git a/execution.h b/execution.h index 9ae0b4f..12603b2 100644 --- a/execution.h +++ b/execution.h @@ -14,7 +14,6 @@ #include "config.h" #include "modeltypes.h" #include "stl-model.h" -#include "context.h" #include "params.h" /* Forward declaration */ @@ -61,7 +60,10 @@ struct release_seq { /** @brief The central structure for model-checking */ class ModelExecution { public: - ModelExecution(struct model_params *params, Scheduler *scheduler, NodeStack *node_stack); + ModelExecution(ModelChecker *m, + struct model_params *params, + Scheduler *scheduler, + NodeStack *node_stack); ~ModelExecution(); Thread * take_step(ModelAction *curr); @@ -88,7 +90,7 @@ public: void check_promises_thread_disabled(); bool isfeasibleprefix() const; - action_list_t * get_actions_on_obj(void * obj, thread_id_t tid); + action_list_t * get_actions_on_obj(void * obj, thread_id_t tid) const; ModelAction * get_last_action(thread_id_t tid) const; bool check_action_enabled(ModelAction *curr); @@ -111,10 +113,12 @@ public: action_list_t * get_action_trace() const { return action_trace; } - void increment_execution_number() { execution_number++; } - - MEMALLOC + SNAPSHOTALLOC private: + int get_execution_number() const; + + ModelChecker *model; + const model_params * const params; /** The scheduler to use: tracks the running/ready Threads */ @@ -182,7 +186,7 @@ private: ModelAction * get_uninitialized_action(const ModelAction *curr) const; action_list_t * const action_trace; - HashTable * const thread_map; + HashTable thread_map; /** Per-object list of actions. Maps an object (i.e., memory location) * to a trace of all actions performed on the object. */ @@ -190,11 +194,11 @@ private: /** Per-object list of actions. Maps an object (i.e., memory location) * to a trace of all actions performed on the object. */ - HashTable * const condvar_waiters_map; + HashTable condvar_waiters_map; - HashTable *, uintptr_t, 4 > * const obj_thrd_map; - SnapVector * const promises; - SnapVector * const futurevalues; + HashTable *, uintptr_t, 4> obj_thrd_map; + SnapVector promises; + SnapVector futurevalues; /** * List of pending release sequences. Release sequences might be @@ -202,10 +206,10 @@ private: * are established. Each entry in the list may only be partially * filled, depending on its pending status. */ - SnapVector * const pending_rel_seqs; + SnapVector pending_rel_seqs; - SnapVector * const thrd_last_action; - SnapVector * const thrd_last_fence_release; + SnapVector thrd_last_action; + SnapVector thrd_last_fence_release; NodeStack * const node_stack; /** A special model-checker Thread; used for associating with @@ -232,8 +236,6 @@ private: */ CycleGraph * const mo_graph; - int execution_number; - Thread * action_select_next_thread(const ModelAction *curr) const; };