syncfunction() public méthode

public syncfunction ( ) : void
Résultat void
Exemple #1
0
 static void Main(String[] args)
 {
     Console.WriteLine("\nTesting the ParallelForStatementElement class");
     Console.WriteLine("\n==========================================\n");
     RangeElement elem = new RangeElement();
     VariableElement var_elem = new VariableElement();
     var_elem.setText("a");
     elem.RANGEVARIABLE = var_elem;
     IntegerElement int_elem = new IntegerElement();
     int_elem.setText("1");
     elem.STARTINGRANGE = int_elem;
     IntegerElement int_elem2 = new IntegerElement();
     int_elem2.setText("10");
     elem.ENDINGRANGE = int_elem2;
     ParallelForElement for_elem = new ParallelForElement();
     for_elem.RANGE = elem;
     ScalarVariableDeclaration scalar_elem = new ScalarVariableDeclaration();
     scalar_elem.setType("int");
     scalar_elem.setVar(var_elem);
     for_elem.ADDCODE = scalar_elem;
     for_elem.syncfunction();
     VariableElement elem2 = new VariableElement();
     elem2.setText("b");
     for_elem.ADDCODE = elem2;
     for_elem.syncfunction();
     RangeElement Relem = new RangeElement();
     Relem = for_elem.RANGE;
     Console.Write("Range is " + Relem.STARTINGRANGE.getText() + " to " + Relem.ENDINGRANGE.getText() + "\n");
     List<List<Element>> elem_list = new List<List<Element>>();
     elem_list = for_elem.PARALLELCODE;
     for(int i=0; i<elem_list.Count;i++)
     {
         List<Element> code = new List<Element>();
         code = elem_list[i];
         for (int j = 0; j<code.Count; j++)
         {
             Console.Write("The parallelfor statement code list "+ (i+1) +" has "+ code[j].ToString() + "\n");
         }
     }
 }