tests/python/c_code@c_ext/cfile.xml
changeset 860 8a51046010d7
parent 859 dbf82971f09d
child 862 bb59865db6e6
equal deleted inserted replaced
859:dbf82971f09d 860:8a51046010d7
     3   <includes>
     3   <includes>
     4 <![CDATA[]]>
     4 <![CDATA[]]>
     5   </includes>
     5   </includes>
     6   <variables>
     6   <variables>
     7     <variable name="TestInput" type="SINT" class="input"/>
     7     <variable name="TestInput" type="SINT" class="input"/>
     8     <variable name="TestOutput" type="SINT" class="input"/>
     8     <variable name="TestOutput" type="SINT" class="output"/>
     9   </variables>
     9   </variables>
    10   <globals>
    10   <globals>
    11 <![CDATA[volatile long Lock=0;
    11 <![CDATA[volatile long Lock=0;
    12 volatile char PtoC=1,CtoP=2;
    12 volatile char PtoC=1,CtoP=2;
    13 
    13 
    54   </cleanUpFunction>
    54   </cleanUpFunction>
    55   <retrieveFunction>
    55   <retrieveFunction>
    56 <![CDATA[]]>
    56 <![CDATA[]]>
    57   </retrieveFunction>
    57   </retrieveFunction>
    58   <publishFunction>
    58   <publishFunction>
    59 <![CDATA[]]>
    59 <![CDATA[if(!AtomicCompareExchange(&Lock, 0, 1)){
       
    60     TestInput = CtoP + PtoC + TestOutput;
       
    61     AtomicCompareExchange(&Lock, 1, 0);
       
    62 }]]>
    60   </publishFunction>
    63   </publishFunction>
    61 </CFile>
    64 </CFile>