delete cv;
}
+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);
}
cv = new ClockVector(NULL, this);
}
+void ModelAction::set_try_lock(bool obtainedlock) {
+ if (obtainedlock)
+ value=VALUE_TRYSUCCESS;
+ else
+ value=VALUE_TRYFAILED;
+}
+
/** Update the model action's read_from action */
void ModelAction::read_from(const ModelAction *act)
{