X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=cyclegraph.cc;h=f060a00e74362b6f9df99649ffd844f7e416d4b9;hb=20926923f6de1790fdd368d5e7fa1738abe7b9a6;hp=c0e8e2af006c5f6f0e0829571c1dc774fd79f391;hpb=fc57069afade38b4d4392890e488a444e87447a8;p=model-checker.git diff --git a/cyclegraph.cc b/cyclegraph.cc index c0e8e2a..f060a00 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -19,10 +19,10 @@ CycleNode * CycleGraph::getNode(const ModelAction * action) { return node; } -/** Adds an edge between two ModelActions. */ - -//the event to happens after the event from - +/** + * Adds an edge between two ModelActions. The ModelAction to happens after the + * ModelAction from. + */ void CycleGraph::addEdge(const ModelAction *to, const ModelAction *from) { CycleNode *fromnode=getNode(from); CycleNode *tonode=getNode(to); @@ -47,8 +47,11 @@ void CycleGraph::addEdge(const ModelAction *to, const ModelAction *from) { } } -//event rmw that reads from the node from - +/** Handles special case of a RMW action. The ModelAction rmw reads + * from the ModelAction from. The key differences are: (1) no write + * can occur in between the rmw and the from action. Only one RMW + * action can read from a given write. + */ void CycleGraph::addRMWEdge(const ModelAction *rmw, const ModelAction * from) { CycleNode *fromnode=getNode(from); CycleNode *rmwnode=getNode(rmw); @@ -116,10 +119,12 @@ void CycleNode::addEdge(CycleNode * node) { edges.push_back(node); } +/** Get the RMW CycleNode that reads from the current CycleNode. */ CycleNode* CycleNode::getRMW() { return hasRMW; } +/** Set a RMW action node that reads from the current CycleNode. */ bool CycleNode::setRMW(CycleNode * node) { CycleNode * oldhasRMW=hasRMW; hasRMW=node;