thread_id_t get_tid() const { return tid; }
action_type get_type() const { return type; }
+ void set_type(action_type _type) { type = _type; }
void set_free() { type = READY_FREE; }
memory_order get_mo() const { return order; }
memory_order get_original_mo() const { return original_order; }
}
}
}
- for (sllnode<ModelAction*> * it2 = action_trace.end();it2 != it;it2=it2->getPrev()) {
+ for (sllnode<ModelAction*> * it2 = action_trace.end();it2 != it;) {
ModelAction *act = it2->getVal();
+ //Do iteration early in case we delete the act
+ it2=it2->getPrev();
bool islastact = false;
ModelAction *lastact = get_last_action(act->get_tid());
if (act == lastact) {
}
if (act->is_read() && act->get_reads_from()->is_free()) {
+ if (act->is_rmw()) {
+ act->set_type(ATOMIC_WRITE);
+ }
removeAction(act);
if (islastact) {
fixupLastAct(act);
}
if (act->is_read()) {
- if (act->get_reads_from()->is_free()) {
+ if (act->is_rmw()) {
+ act->set_type(ATOMIC_WRITE);
+ } else if (act->get_reads_from()->is_free()) {
removeAction(act);
if (islastact) {
fixupLastAct(act);