projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b8c64c
)
clockvector: add print() method
author
Brian Norris
<banorris@uci.edu>
Wed, 16 May 2012 19:45:03 +0000
(12:45 -0700)
committer
Brian Norris
<banorris@uci.edu>
Sat, 26 May 2012 02:11:18 +0000
(19:11 -0700)
clockvector.cc
patch
|
blob
|
history
clockvector.h
patch
|
blob
|
history
diff --git
a/clockvector.cc
b/clockvector.cc
index da459d0e0faf461aab67af55ab7f3338082fdd9d..69503aaf2a01f8df55c3f9626179cc3e39e12ba7 100644
(file)
--- 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 c4aabeb162829cf4883c1c546e2df0651fbfe5eb..eb7086253d7f97e79b0f1d1ce41ef7b4e988e561 100644
(file)
--- 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;