/**
@Begin
@Interface: Write_Unlock
- @Commit_point_set: Write_Unlock_Point
+ @Commit_point_set: Write_Unlock_Point | Write_Unlock_Clear
@Check:
reader_lock_cnt == 0 && writer_lock_acquired
@Action:
@Label: Write_Unlock_Point
@End
*/
+
+ /**
+ //@Begin
+ @Commit_point_clear: true
+ @Label: Write_Unlock_Clear
+ @End
+ */
}
rwlock_t mylock;
public static final String SPEC_ANNO_TYPE_INTERFACE_END = "INTERFACE_END";
public static final String SPEC_ANNO_TYPE_POTENTIAL_CP_DEFINE = "POTENTIAL_CP_DEFINE";
public static final String SPEC_ANNO_TYPE_CP_DEFINE_CHECK = "CP_DEFINE_CHECK";
+ public static final String SPEC_ANNO_TYPE_CP_CLEAR = "CP_CLEAR";
public static final String SPEC_ANNO_TYPE_CP_DEFINE = "CP_DEFINE";
public static final String SPEC_ANNOTATION = "spec_annotation";
public static final String SPEC_ANNOTATION_FIELD_TYPE = "type";
newCode.add("\t\t" + ASSIGN_TO_PTR(structName, "interface_num", interfaceNum));
newCode.add("\t\t" + STRUCT_NEW_DECLARE_DEFINE(SPEC_ANNOTATION, anno));
newCode.add("\t\t"
- + ASSIGN_TO_PTR(anno, "type", SPEC_ANNO_TYPE_CP_DEFINE_CHECK));
+ + ASSIGN_TO_PTR(anno, "type", SPEC_ANNO_TYPE_CP_CLEAR));
newCode.add("\t\t" + ASSIGN_TO_PTR(anno, "annotation", structName));
newCode.add("\t\t" + ANNOTATE(semantics, anno));
newCode.add("\t" + "}");
import java.util.HashSet;
import edu.uci.eecs.specCompiler.grammerParser.ParseException;
+import edu.uci.eecs.specCompiler.specExtraction.CPClearConstruct;
import edu.uci.eecs.specCompiler.specExtraction.CPDefineCheckConstruct;
import edu.uci.eecs.specCompiler.specExtraction.CPDefineConstruct;
import edu.uci.eecs.specCompiler.specExtraction.ClassBeginConstruct;
commitPointLabel2Num.put(label, _commitPointNum++);
num2CommitPointLabel.put(_commitPointNum, label);
+ CPLabel2Construct.put(label, construct);
+ } else if (construct instanceof CPClearConstruct) {
+ CPClearConstruct theConstruct = (CPClearConstruct) construct;
+ label = theConstruct.label;
+ checkLabelDuplication(construct, label);
+ // Number the commit point define check label
+ commitPointLabel2Num.put(label, _commitPointNum++);
+ num2CommitPointLabel.put(_commitPointNum, label);
+
CPLabel2Construct.put(label, construct);
} else if (construct instanceof CPDefineConstruct) {
CPDefineConstruct theConstruct = (CPDefineConstruct) construct;