From 9c085ae909dbe3aba08a518cc7c9ac6134773108 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 10 Aug 2012 14:57:20 -0700 Subject: [PATCH] action: rework/rename 'synchronized()' to 'synchronize_with()' Fix some comments, names, etc. Privatize synchronized()/synchronize_with(), since it's only intended for within other wrapper actions performed on ModelAction. --- action.cc | 14 +++++++------- action.h | 3 +-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/action.cc b/action.cc index a88cc45..131cb74 100644 --- a/action.cc +++ b/action.cc @@ -161,23 +161,23 @@ void ModelAction::create_cv(const ModelAction *parent) cv = new ClockVector(NULL, this); } - /** Update the model action's read_from action */ void ModelAction::read_from(const ModelAction *act) { ASSERT(cv); if (act!=NULL && act->is_release() && this->is_acquire()) { - synchronized(act); + synchronize_with(act); cv->merge(act->cv); } reads_from = act; } - -/** Synchronize the current thread with the thread corresponding to - * the ModelAction parameter. */ - -void ModelAction::synchronized(const ModelAction *act) { +/** + * Synchronize the current thread with the thread corresponding to the + * ModelAction parameter. + * @param act The ModelAction to synchronize with + */ +void ModelAction::synchronize_with(const ModelAction *act) { model->check_promises(cv, act->cv); cv->merge(act->cv); } diff --git a/action.h b/action.h index 7c45707..ffe60dc 100644 --- a/action.h +++ b/action.h @@ -81,8 +81,6 @@ public: void create_cv(const ModelAction *parent = NULL); ClockVector * get_cv() const { return cv; } void read_from(const ModelAction *act); - void synchronized(const ModelAction *act); - bool happens_before(const ModelAction *act) const; @@ -98,6 +96,7 @@ public: MEMALLOC private: + void synchronize_with(const ModelAction *act); /** Type of action (read, write, thread create, thread yield, thread join) */ action_type type; -- 2.34.1