Add yield block support. The idea is to not generate executions with yield actions.
[cdsspec-compiler.git] / execution.h
index e9c78ded53f7c45eaf04588287e61e946f17abf5..7f63e6d99812c98f5732d35c52a1e04f8691ac17 100644 (file)
@@ -61,11 +61,13 @@ struct release_seq {
 class ModelExecution {
 public:
        ModelExecution(ModelChecker *m,
-                       struct model_params *params,
+                       const struct model_params *params,
                        Scheduler *scheduler,
                        NodeStack *node_stack);
        ~ModelExecution();
 
+       const struct model_params * get_params() const { return params; }
+
        Thread * take_step(ModelAction *curr);
        void fixup_release_sequences();
 
@@ -107,11 +109,12 @@ public:
        bool is_feasible_prefix_ignore_relseq() const;
        bool is_infeasible() const;
        bool is_deadlocked() const;
+       bool is_yieldblocked() const;
        bool too_many_steps() const;
 
        ModelAction * get_next_backtrack();
 
-       action_list_t * get_action_trace() const { return action_trace; }
+       action_list_t * get_action_trace() { return &action_trace; }
 
        SNAPSHOTALLOC
 private:
@@ -185,18 +188,18 @@ private:
 
        ModelAction * get_uninitialized_action(const ModelAction *curr) const;
 
-       action_list_t * const action_trace;
-       HashTable<int, Thread *, int> * const thread_map;
+       action_list_t action_trace;
+       SnapVector<Thread *> thread_map;
 
        /** Per-object list of actions. Maps an object (i.e., memory location)
         * to a trace of all actions performed on the object. */
-       HashTable<const void *, action_list_t *, uintptr_t, 4> * const obj_map;
+       HashTable<const void *, action_list_t *, uintptr_t, 4> obj_map;
 
        /** Per-object list of actions. Maps an object (i.e., memory location)
         * to a trace of all actions performed on the object. */
-       HashTable<const void *, action_list_t *, uintptr_t, 4> * const condvar_waiters_map;
+       HashTable<const void *, action_list_t *, uintptr_t, 4> condvar_waiters_map;
 
-       HashTable<void *, SnapVector<action_list_t> *, uintptr_t, 4 > * const obj_thrd_map;
+       HashTable<void *, SnapVector<action_list_t> *, uintptr_t, 4> obj_thrd_map;
        SnapVector<Promise *> promises;
        SnapVector<struct PendingFutureValue> futurevalues;