From 310276660b83b8dd313c512f07510268bcc1e3fc Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 16 May 2012 12:45:03 -0700 Subject: [PATCH] clockvector: add print() method --- clockvector.cc | 7 +++++++ clockvector.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/clockvector.cc b/clockvector.cc index da459d0..69503aa 100644 --- a/clockvector.cc +++ b/clockvector.cc @@ -59,3 +59,10 @@ bool ClockVector::happens_before(ModelAction *act, thread_id_t id) return act->get_seq_number() < clock[i]; return false; } + +void ClockVector::print() +{ + int i; + for (i = 0; i < num_threads; i++) + printf("%d%c", clock[i], (i == num_threads - 1) ? '\n' : ' '); +} diff --git a/clockvector.h b/clockvector.h index c4aabeb..eb70862 100644 --- a/clockvector.h +++ b/clockvector.h @@ -14,6 +14,8 @@ public: void merge(ClockVector *cv); bool happens_before(ModelAction *act, thread_id_t id); + void print(); + MEMALLOC private: int *clock; -- 2.34.1