+ /** We can't free the clock vector:
+ * The reason is as follows:
+ * Clock vectors are snapshotting state... when we delete model actions
+ * they are at the end of the node list and have invalid old clock vectors...
+ * They are already free at that point...
+ */
+
+ /* if (cv)
+ delete cv;*/
+}
+
+void ModelAction::copy_from_new(ModelAction *newaction)
+{
+ seq_number = newaction->seq_number;
+}
+
+void ModelAction::set_seq_number(modelclock_t num)
+{
+ ASSERT(seq_number == ACTION_INITIAL_CLOCK);
+ seq_number = num;
+}
+
+bool ModelAction::is_mutex_op() const
+{
+ return type == ATOMIC_LOCK || type == ATOMIC_TRYLOCK || type == ATOMIC_UNLOCK;
+}
+
+bool ModelAction::is_lock() const
+{
+ return type == ATOMIC_LOCK;
+}
+
+bool ModelAction::is_unlock() const
+{
+ return type == ATOMIC_UNLOCK;
+}
+
+bool ModelAction::is_trylock() const
+{
+ return type == ATOMIC_TRYLOCK;
+}
+
+bool ModelAction::is_success_lock() const
+{
+ return type == ATOMIC_LOCK || (type == ATOMIC_TRYLOCK && value == VALUE_TRYSUCCESS);
+}
+
+bool ModelAction::is_failed_trylock() const
+{
+ return (type == ATOMIC_TRYLOCK && value == VALUE_TRYFAILED);