X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=clockvector.cc;h=594daa8a75d968f500d3248085045a559c3e13fa;hb=53748c53db55c1230d4b191caf0e4016a2b9c0a6;hp=6c6e2fa579e606377ec45bed18bddac8d357cbb8;hpb=80617a5bb7ad550ac821b68e81dce05b5c906309;p=model-checker.git diff --git a/clockvector.cc b/clockvector.cc index 6c6e2fa..594daa8 100644 --- a/clockvector.cc +++ b/clockvector.cc @@ -84,6 +84,17 @@ bool ClockVector::synchronized_since(const ModelAction *act) const return false; } +bool ClockVector::has_synchronized_with(const ClockVector *cv) const +{ + ASSERT(cv); + if (cv->num_threads > num_threads) + return false; + for (int i = 0; i < cv->num_threads; i++) + if (cv->clock[i] > clock[i]) + return false; + return true; +} + /** Gets the clock corresponding to a given thread id from the clock vector. */ modelclock_t ClockVector::getClock(thread_id_t thread) { int threadid = id_to_int(thread);