+ /**
+ * We can't free the clock vector:
+ * 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 which have already been rolled back to an unallocated state.
+ */
+
+ /*
+ if (cv)
+ delete cv; */
+}
+
+void ModelAction::copy_from_new(ModelAction *newaction)
+{
+ seq_number = newaction->seq_number;
+}
+
+void ModelAction::set_seq_number(modelclock_t num)
+{
+ /* ATOMIC_UNINIT actions should never have non-zero clock */
+ ASSERT(!is_uninitialized());
+ ASSERT(seq_number == ACTION_INITIAL_CLOCK);
+ seq_number = num;
+}
+
+bool ModelAction::is_thread_start() const
+{
+ return type == THREAD_START;
+}
+
+bool ModelAction::is_relseq_fixup() const
+{
+ return type == MODEL_FIXUP_RELSEQ;
+}
+
+bool ModelAction::is_mutex_op() const
+{
+ return type == ATOMIC_LOCK || type == ATOMIC_TRYLOCK || type == ATOMIC_UNLOCK || type == ATOMIC_WAIT || type == ATOMIC_NOTIFY_ONE || type == ATOMIC_NOTIFY_ALL;
+}
+
+bool ModelAction::is_lock() const
+{
+ return type == ATOMIC_LOCK;
+}
+
+bool ModelAction::is_wait() const {
+ return type == ATOMIC_WAIT;
+}
+
+bool ModelAction::is_notify() const {
+ return type==ATOMIC_NOTIFY_ONE || type==ATOMIC_NOTIFY_ALL;
+}
+
+bool ModelAction::is_notify_one() const {
+ return type==ATOMIC_NOTIFY_ONE;
+}
+
+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);
+}
+
+bool ModelAction::is_uninitialized() const
+{
+ return type == ATOMIC_UNINIT;