add support for datarace detection...
[c11tester.git] / clockvector.cc
index 95896ed3a61a7d62b725028b04d7c939245f83a8..1956b18a127742a3584b0abfa74233fb92332c3c 100644 (file)
@@ -84,6 +84,19 @@ bool ClockVector::synchronized_since(ModelAction *act) const
        return false;
 }
 
+/** 
+ * Gets the clock corresponding to a given thread id from the clock
+ * vector. */
+
+int ClockVector::getClock(thread_id_t thread) {
+       int threadid = id_to_int(thread);
+
+       if (threadid < num_threads)
+               return clock[threadid];
+       else
+               return 0;
+}
+
 /** @brief Formats and prints this ClockVector's data. */
 void ClockVector::print() const
 {