* @param act is the action to consider exploring a reordering.
* @return tells whether we have to explore a reordering.
*/
-bool ModelAction::is_synchronizing(const ModelAction *act) const
+bool ModelAction::could_synchronize_with(const ModelAction *act) const
{
//Same thread can't be reordered
if (same_thread(act))
// Explore interleavings of seqcst writes to guarantee total order
// of seq_cst operations that don't commute
- if (is_write() && is_seqcst() && act->is_write() && act->is_seqcst())
+ if ((is_write() || act->is_write()) && is_seqcst() && act->is_seqcst())
return true;
// Explore synchronizing read/write pairs
if (is_read() && is_acquire() && act->is_write() && act->is_release())
return true;
- if (is_write() && is_release() && act->is_read() && act->is_acquire())
- return true;
// Otherwise handle by reads_from relation
return false;
bool same_var(const ModelAction *act) const;
bool same_thread(const ModelAction *act) const;
bool is_conflicting_lock(const ModelAction *act) const;
- bool is_synchronizing(const ModelAction *act) const;
+ bool could_synchronize_with(const ModelAction *act) const;
void create_cv(const ModelAction *parent = NULL);
ClockVector * get_cv() const { return cv; }
action_list_t::reverse_iterator rit;
for (rit = list->rbegin(); rit != list->rend(); rit++) {
ModelAction *prev = *rit;
- if (act->is_synchronizing(prev))
+ if (prev->could_synchronize_with(act))
return prev;
}
break;
}
added = true;
break;
- } else if (act->is_read() && !act->is_synchronizing(curr) &&
+ } else if (act->is_read() && !act->could_synchronize_with(curr) &&
!act->same_thread(curr)) {
/* We have an action that:
(1) did not happen before us
const ModelAction *act = promise->get_action();
if (!act->happens_before(curr) &&
act->is_read() &&
- !act->is_synchronizing(curr) &&
+ !act->could_synchronize_with(curr) &&
!act->same_thread(curr) &&
promise->get_value() == curr->get_value()) {
curr->get_node()->set_promise(i);