Find a faster way to get currently executing thread's id
[c11tester.git] / action.cc
index af42a1f06e952580b2f984c2f81c134b89748bf4..4cdca0d7a7272b2f4c6eef265ef34ca613bc0c3f 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -111,8 +111,7 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        /* References to NULL atomic variables can end up here */
        ASSERT(loc);
        this->size = size;
-       Thread *t = thread_current();
-       this->tid = t->get_id();
+       this->tid = thread_current_id();
 }
 
 
@@ -146,8 +145,7 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order
        /* References to NULL atomic variables can end up here */
        ASSERT(loc);
        this->size = size;
-       Thread *t = thread_current();
-       this->tid = t->get_id();
+       this->tid = thread_current_id();
 }
 
 
@@ -720,6 +718,9 @@ void ModelAction::print() const
        model_print("%-4d %-2d   %-14s  %7s  %14p   %-#18" PRIx64,
                                                        seq_number, id_to_int(tid), type_str, mo_str, location, get_return_value());
        if (is_read()) {
+               if (is_write()) {
+                       model_print("(%" PRIx64 ")", get_write_value());
+               }
                if (reads_from)
                        model_print("  %-3d", reads_from->get_seq_number());
                else