X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=clockvector.cc;h=2ef8b03d9e36e22ce4ee6989ec31d20633717ed2;hb=f3ef22bef8d339c7d45b7d7232cdcf183a0b7776;hp=f411f50d64bcb9ca6c1b7eefe48f871bcc1c1bff;hpb=73cd0247207fb071effa55b9f39e3db711412d96;p=model-checker.git diff --git a/clockvector.cc b/clockvector.cc index f411f50..2ef8b03 100644 --- a/clockvector.cc +++ b/clockvector.cc @@ -49,12 +49,18 @@ void ClockVector::merge(ClockVector *cv) clock = clk; } -bool ClockVector::happens_before(ModelAction *act, thread_id_t id) +/** + * + * @return true if this ClockVector's thread has synchronized with act's + * thread, false otherwise. That is, this function returns: + *
act <= cv[act->tid] + */ +bool ClockVector::synchronized_since(ModelAction *act) { - int i = id_to_int(id); + int i = id_to_int(act->get_tid()); if (i < num_threads) - return act->get_seq_number() < clock[i]; + return act->get_seq_number() <= clock[i]; return false; }