X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=action.cc;h=df73d2099cc7641be668e03878bfc29f61e190fc;hb=5ca7bf3bd5afb9ca961fe8daaa1fae2d88c39211;hp=85a2a766b3583eabb2504bdc5537348520a840b9;hpb=a3dc0324f0fd34a80919de8c343de96468992292;p=c11tester.git diff --git a/action.cc b/action.cc index 85a2a766..df73d209 100644 --- a/action.cc +++ b/action.cc @@ -45,6 +45,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc, value(value), type(type), original_type(ATOMIC_NOP), + swap_flag(false), order(order), original_order(order), seq_number(ACTION_INITIAL_CLOCK) @@ -77,9 +78,11 @@ ModelAction::ModelAction(action_type_t type, memory_order order, uint64_t value, trace_ref(NULL), thrdmap_ref(NULL), action_ref(NULL), + func_act_ref(NULL), value(value), type(type), original_type(ATOMIC_NOP), + swap_flag(false), order(order), original_order(order), seq_number(ACTION_INITIAL_CLOCK) @@ -111,9 +114,11 @@ 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), + swap_flag(false), order(order), original_order(order), seq_number(ACTION_INITIAL_CLOCK) @@ -149,9 +154,11 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order trace_ref(NULL), thrdmap_ref(NULL), action_ref(NULL), + func_act_ref(NULL), value(value), type(type), original_type(ATOMIC_NOP), + swap_flag(false), order(order), original_order(order), seq_number(ACTION_INITIAL_CLOCK) @@ -188,9 +195,11 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order trace_ref(NULL), thrdmap_ref(NULL), action_ref(NULL), + func_act_ref(NULL), value(value), type(type), original_type(ATOMIC_NOP), + swap_flag(false), order(order), original_order(order), seq_number(ACTION_INITIAL_CLOCK) @@ -614,7 +623,7 @@ uint64_t ModelAction::get_reads_from_value() const */ uint64_t ModelAction::get_write_value() const { - ASSERT(is_write()); + ASSERT(is_write() || is_free()); return value; } @@ -785,4 +794,9 @@ void ModelAction::use_original_type() action_type_t tmp = type; type = original_type; original_type = tmp; + + if (swap_flag) + swap_flag = false; + else + swap_flag = true; }