Toward transferring the removal of some actions from ModelExecution to FuncNode or...
[c11tester.git] / action.cc
index d65695446486e58a929196335660d8c3172cb94d..85a2a766b3583eabb2504bdc5537348520a840b9 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -41,8 +41,10 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        trace_ref(NULL),
        thrdmap_ref(NULL),
        action_ref(NULL),
+       func_act_ref(NULL),
        value(value),
        type(type),
+       original_type(ATOMIC_NOP),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -77,6 +79,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, uint64_t value,
        action_ref(NULL),
        value(value),
        type(type),
+       original_type(ATOMIC_NOP),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -110,6 +113,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        action_ref(NULL),
        value(value),
        type(type),
+       original_type(ATOMIC_NOP),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -147,6 +151,7 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order
        action_ref(NULL),
        value(value),
        type(type),
+       original_type(ATOMIC_NOP),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -185,6 +190,7 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order
        action_ref(NULL),
        value(value),
        type(type),
+       original_type(ATOMIC_NOP),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -772,3 +778,11 @@ cdsc::mutex * ModelAction::get_mutex() const
        else
                return NULL;
 }
+
+/** @brief Swap type with original type */
+void ModelAction::use_original_type()
+{
+       action_type_t tmp = type;
+       type = original_type;
+       original_type = tmp;
+}