return false;
}
-void ModelAction::create_cv(ModelAction *parent)
+void ModelAction::create_cv(const ModelAction *parent)
{
ASSERT(cv == NULL);
cv = new ClockVector(NULL, this);
}
-void ModelAction::read_from(ModelAction *act)
+void ModelAction::read_from(const ModelAction *act)
{
ASSERT(cv);
if (act->is_release() && this->is_acquire())
* @return true if this action's thread has synchronized with act's thread
* since the execution of act, false otherwise.
*/
-bool ModelAction::happens_before(ModelAction *act)
+bool ModelAction::happens_before(const ModelAction *act) const
{
return act->cv->synchronized_since(this);
}
bool same_thread(const ModelAction *act) const;
bool is_synchronizing(const ModelAction *act) const;
- void create_cv(ModelAction *parent = NULL);
+ void create_cv(const ModelAction *parent = NULL);
ClockVector * get_cv() const { return cv; }
- void read_from(ModelAction *act);
+ void read_from(const ModelAction *act);
- bool happens_before(ModelAction *act);
+ bool happens_before(const ModelAction *act) const;
inline bool operator <(const ModelAction& act) const {
return get_seq_number() < act.get_seq_number();
* thread, false otherwise. That is, this function returns:
* <BR><CODE>act <= cv[act->tid]</CODE>
*/
-bool ClockVector::synchronized_since(ModelAction *act) const
+bool ClockVector::synchronized_since(const ModelAction *act) const
{
int i = id_to_int(act->get_tid());
ClockVector(ClockVector *parent = NULL, ModelAction *act = NULL);
~ClockVector();
void merge(ClockVector *cv);
- bool synchronized_since(ModelAction *act) const;
+ bool synchronized_since(const ModelAction *act) const;
void print() const;
modelclock_t getClock(thread_id_t thread);