model: add get_last_seq_cst_fence
[c11tester.git] / action.cc
index 1387ed15b67c9ac25d7fcba68491bbb72d8ff236..9427c7d204e4a8e3a509f7cda437c7c67439e58f 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -156,6 +156,11 @@ bool ModelAction::is_initialization() const
        return type == ATOMIC_INIT;
 }
 
+bool ModelAction::is_relaxed() const
+{
+       return order == std::memory_order_relaxed;
+}
+
 bool ModelAction::is_acquire() const
 {
        switch (order) {
@@ -468,22 +473,22 @@ void ModelAction::print() const
                break;
        }
 
-       printf("(%4d) Thread: %-2d   Action: %-13s   MO: %7s  Loc: %14p   Value: %-#18" PRIx64,
+       model_print("(%4d) Thread: %-2d   Action: %-13s   MO: %7s  Loc: %14p   Value: %-#18" PRIx64,
                        seq_number, id_to_int(tid), type_str, mo_str, location, valuetoprint);
        if (is_read()) {
                if (reads_from)
-                       printf("  Rf: %-3d", reads_from->get_seq_number());
+                       model_print("  Rf: %-3d", reads_from->get_seq_number());
                else
-                       printf("  Rf: ?  ");
+                       model_print("  Rf: ?  ");
        }
        if (cv) {
                if (is_read())
-                       printf(" ");
+                       model_print(" ");
                else
-                       printf("          ");
+                       model_print("          ");
                cv->print();
        } else
-               printf("\n");
+               model_print("\n");
 }
 
 /** @brief Print nicely-formatted info about this ModelAction */