action: support ATOMIC_INIT
[model-checker.git] / action.cc
index 68a34aad8c76476084052c8fa615c5c54a502e1f..d5131f0b03dfc9c7c9b86c901ca4215fbfac8245 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -33,7 +33,7 @@ bool ModelAction::is_read() const
 
 bool ModelAction::is_write() const
 {
-       return type == ATOMIC_WRITE;
+       return type == ATOMIC_WRITE || type == ATOMIC_INIT;
 }
 
 bool ModelAction::is_rmw() const
@@ -41,6 +41,11 @@ bool ModelAction::is_rmw() const
        return type == ATOMIC_RMW;
 }
 
+bool ModelAction::is_initialization() const
+{
+       return type == ATOMIC_INIT;
+}
+
 bool ModelAction::is_acquire() const
 {
        switch (order) {
@@ -166,6 +171,9 @@ void ModelAction::print(void) const
        case ATOMIC_RMW:
                type_str = "atomic rmw";
                break;
+       case ATOMIC_INIT:
+               type_str = "init atomic";
+               break;
        default:
                type_str = "unknown type";
        }