+ this->type = act->type;
+ this->order = act->order;
+}
+
+/**
+ * Get the Thread which is the operand of this action. This is only valid for
+ * THREAD_* operations (currently only for THREAD_CREATE and THREAD_JOIN). Note
+ * that this provides a central place for determining the conventions of Thread
+ * storage in ModelAction, where we generally aren't very type-safe (e.g., we
+ * store object references in a (void *) address.
+ *
+ * For THREAD_CREATE, this yields the Thread which is created.
+ * For THREAD_JOIN, this yields the Thread we are joining with.
+ *
+ * @return The Thread which this action acts on, if exists; otherwise NULL
+ */
+Thread * ModelAction::get_thread_operand() const
+{
+ if (type == THREAD_CREATE)
+ /* THREAD_CREATE uses (Thread *) for location */
+ return (Thread *)get_location();
+ else if (type == THREAD_JOIN)
+ /* THREAD_JOIN uses (Thread *) for location */
+ return (Thread *)get_location();
+ else
+ return NULL;
+}
+
+/** This method changes an existing read part of an RMW action into either:
+ * (1) a full RMW action in case of the completed write or
+ * (2) a READ action in case a failed action.
+ * @todo If the memory_order changes, we may potentially need to update our
+ * clock vector.
+ */
+void ModelAction::process_rmw(ModelAction *act)
+{
+ this->order = act->order;
+ if (act->is_rmwc())
+ this->type = ATOMIC_READ;
+ else if (act->is_rmw()) {
+ this->type = ATOMIC_RMW;
+ this->value = act->value;
+ }
+}
+
+/** The is_synchronizing method should only explore interleavings if:
+ * (1) the operations are seq_cst and don't commute or
+ * (2) the reordering may establish or break a synchronization relation.
+ * Other memory operations will be dealt with by using the reads_from
+ * relation.
+ *
+ * @param act is the action to consider exploring a reordering.
+ * @return tells whether we have to explore a reordering.
+ */
+bool ModelAction::could_synchronize_with(const ModelAction *act) const
+{
+ // Same thread can't be reordered
+ if (same_thread(act))
+ return false;
+
+ // Different locations commute
+ if (!same_var(act))