From: Brian Norris Date: Wed, 16 May 2012 19:45:03 +0000 (-0700) Subject: clockvector: add print() method X-Git-Tag: pldi2013~392^2~23 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=310276660b83b8dd313c512f07510268bcc1e3fc;p=model-checker.git clockvector: add print() method --- 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;