last_fence_release(NULL),
cv(NULL),
rf_cv(NULL),
- 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)
last_fence_release(NULL),
cv(NULL),
rf_cv(NULL),
- 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)
last_fence_release(NULL),
cv(NULL),
rf_cv(NULL),
- 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)
/* References to NULL atomic variables can end up here */
ASSERT(loc);
this->size = size;
- Thread *t = thread_current();
- this->tid = t->get_id();
+ this->tid = thread_current_id();
}
last_fence_release(NULL),
cv(NULL),
rf_cv(NULL),
- 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)
/* References to NULL atomic variables can end up here */
ASSERT(loc);
this->size = size;
- Thread *t = thread_current();
- this->tid = t->get_id();
+ this->tid = thread_current_id();
}
last_fence_release(NULL),
cv(NULL),
rf_cv(NULL),
- 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)
* vectors which have already been rolled back to an unallocated state.
*/
- /*
- if (cv)
- delete cv; */
+
+ if (cv)
+ delete cv;
+ if (rf_cv)
+ delete rf_cv;
}
int ModelAction::getSize() const {
return type == ATOMIC_WAIT || type == ATOMIC_TIMEDWAIT;
}
+bool ModelAction::is_timedwait() const {
+ return type == ATOMIC_TIMEDWAIT;
+}
+
bool ModelAction::is_notify() const {
return type == ATOMIC_NOTIFY_ONE || type == ATOMIC_NOTIFY_ALL;
}
*/
uint64_t ModelAction::get_write_value() const
{
- ASSERT(is_write() || is_free());
+ ASSERT(is_write());
return value;
}
model_print("%-4d %-2d %-14s %7s %14p %-#18" PRIx64,
seq_number, id_to_int(tid), type_str, mo_str, location, get_return_value());
if (is_read()) {
+ if (is_write()) {
+ model_print("(%" PRIx64 ")", get_write_value());
+ }
if (reads_from)
model_print(" %-3d", reads_from->get_seq_number());
else
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;
-
- if (swap_flag)
- swap_flag = false;
- else
- swap_flag = true;
-}