be much more careful about sending values backwards...
[model-checker.git] / model.h
diff --git a/model.h b/model.h
index 68831b867885fe83a7765e2716c8d07cc67f9726..c99e0f8b424ddbe8079593713e498e53fe6fb80e 100644 (file)
--- a/model.h
+++ b/model.h
@@ -39,8 +39,7 @@ struct model_params {
 };
 
 struct PendingFutureValue {
-       uint64_t value;
-       modelclock_t expiration;
+       ModelAction *writer;
        ModelAction * act;
 };
 
@@ -118,13 +117,16 @@ private:
        /** The scheduler to use: tracks the running/ready Threads */
        Scheduler *scheduler;
 
+       bool sleep_can_read_from(ModelAction * curr, const ModelAction *write);
        bool thin_air_constraint_may_allow(const ModelAction * writer, const ModelAction *reader);
+       bool mo_may_allow(const ModelAction * writer, const ModelAction *reader);
        bool has_asserted() {return asserted;}
        void reset_asserted() {asserted=false;}
        int num_executions;
        int num_feasible_executions;
        bool promises_expired();
-
+       void execute_sleep_set();
+       void wake_up_sleeping_actions(ModelAction * curr);
        modelclock_t get_next_seq_num();
 
        /**
@@ -185,8 +187,8 @@ private:
        HashTable<const void *, action_list_t, uintptr_t, 4> *lock_waiters_map;
 
        HashTable<void *, std::vector<action_list_t>, uintptr_t, 4 > *obj_thrd_map;
-       std::vector<Promise *> *promises;
-       std::vector<struct PendingFutureValue> *futurevalues;
+       std::vector< Promise *, SnapshotAlloc<Promise *> > *promises;
+       std::vector< struct PendingFutureValue, SnapshotAlloc<struct PendingFutureValue> > *futurevalues;
 
        /**
         * List of pending release sequences. Release sequences might be
@@ -194,9 +196,9 @@ private:
         * are established. Each entry in the list may only be partially
         * filled, depending on its pending status.
         */
-       std::vector<struct release_seq *> *pending_rel_seqs;
+       std::vector< struct release_seq *, SnapshotAlloc<struct release_seq *> > *pending_rel_seqs;
 
-       std::vector<ModelAction *> *thrd_last_action;
+       std::vector< ModelAction *, SnapshotAlloc<ModelAction *> > *thrd_last_action;
        NodeStack *node_stack;
 
        /** Private data members that should be snapshotted. They are grouped